Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting an existing service is missing important properties #1290

Closed
manast opened this issue Sep 4, 2020 · 9 comments
Closed

Getting an existing service is missing important properties #1290

manast opened this issue Sep 4, 2020 · 9 comments
Labels
kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed

Comments

@manast
Copy link

manast commented Sep 4, 2020

For some reason, getting the istio service (installed as an addon in GKE) is missing important properties such as status and metadata:

const ingress = k8s.core.v1.Service.get(
      "ingress",
      "istio-system/istio-ingressgateway",
      { provider }
    );
 Service {
        __pulumiResource: true,
        __transformations: [],
        __name: 'ingress',
        __providers: { kubernetes: [Provider] },
        __protect: false,
        __aliases: [],
        urn: OutputImpl {
          __pulumiOutput: true,
          resources: [Function],
          allResources: [Function],
          isKnown: [Promise],
          isSecret: [Promise],
          promise: [Function],
          toString: [Function],
          toJSON: [Function]
        },
        id: OutputImpl {
          __pulumiOutput: true,
          resources: [Function],
          allResources: [Function],
          isKnown: [Promise],
          isSecret: [Promise],
          promise: [Function],
          toString: [Function],
          toJSON: [Function]
        },
        __pulumiCustomResource: true,
        __pulumiType: 'kubernetes:core/v1:Service'
      },

In my case I am interested in the metadata object, the reason is that I would like to add some annotations while preserving the old metadata:

    const metadata = ingress.metadata.apply((metadata) => ({
      ...metadata,
      annotations: {
        "external-dns.alpha.kubernetes.io/hostname": `*.${location}.${domain}.`,
      },
    }));

    const istioIngress = new k8s.core.v1.Service(
      "ingress",
      {
        metadata,
      },
      { provider, import: "istio-system/istio-ingressgateway" }
    );
@leezen leezen transferred this issue from pulumi/pulumi-gcp Sep 4, 2020
@leezen
Copy link
Contributor

leezen commented Sep 4, 2020

Could you please describe where you're not seeing the metadata? Are you saying that ingress.metadata is an empty object?

@manast
Copy link
Author

manast commented Sep 5, 2020

yes, the full ingress object is shown in the issue, no status and no metadata.

@marioapardo
Copy link

marioapardo commented Sep 9, 2020

The same happens with the Secrets that ServiceAccount generates when trying to obtain the token, the answer is none

@leezen
Copy link
Contributor

leezen commented Sep 10, 2020

@manast And you're able to obtain those properties via kubectl? The get call is using the k8s API, so I would be surprised if there's a difference in the underlying data.

@marioapardo
Copy link

marioapardo commented Sep 10, 2020

@leezen With kubectl you get the data without problems. We currently use the python sdk. (cluster is EKS)

@marioapardo
Copy link

This is the output of the complete resource that you get
cerberus_token : { id : "kube-system/cerberus-token-q7hph" urn: "urn:pulumi:cerberus::sandbox-eks-pre::cerberus:eks:Cluster$cerberus:eks:Master$kubernetes:core/v1:Secret::sandbox-eks-pre-cerberus-aws-k8s-cerberus-secret" }

@manast
Copy link
Author

manast commented Sep 10, 2020

@manast And you're able to obtain those properties via kubectl? The get call is using the k8s API, so I would be surprised if there's a difference in the underlying data.

kubectl is just working fine...

@iridian-ks
Copy link

I noticed the exact same behavior. Certain attributes on Secrets were simply missing. Was also using the Python SDK.

I did straight pulumi.debugs of the Secret objects and only the id attribute was available.

Upgrading Pulumi and the k8s provider to the latest resolved it for me. Looking at the pulumi.debugs all of the attributes are there. My guess is this must have been a bug in the Python SDK with data bindings.

@leezen leezen added kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed labels Apr 23, 2021
@leezen
Copy link
Contributor

leezen commented Apr 23, 2021

Apologies for the lack of updates on this issue. We ended up tracking this down in #1479 (fixed via pulumi/pulumi#6433) and didn't connect these issues together.

@leezen leezen closed this as completed Apr 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Projects
None yet
Development

No branches or pull requests

5 participants