-
Notifications
You must be signed in to change notification settings - Fork 113
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
Computed annotations are not showing up correctly in preview for autonamed resources #438
Comments
@mazamats Thanks for the detailed report! I was able to reproduce this behavior. The annotations are not showing up in preview for either the Ingress or Pod, but they are created when the update runs. Here's a slightly modified version that successfully updates: import * as k8s from "@pulumi/kubernetes";
import * as aws from "@pulumi/aws";
const securityGroup = new aws.ec2.SecurityGroup('sgtest', {
description: "Container node security group",
egress: [{
cidrBlocks: ["0.0.0.0/0"],
fromPort: 0,
protocol: "-1",
toPort: 0,
}],
ingress: [{
cidrBlocks: ["0.0.0.0/0"],
fromPort: 0,
protocol: "-1",
toPort: 0,
}],
});
const pod = new k8s.core.v1.Pod("podtest", {
metadata: {
annotations: {
"foo": "bar",
'computed-value': securityGroup.id
}
},
spec: {
containers: [{
name: "nginx",
image: "nginx:1.13-alpine"
}]
}
});
const ingress = new k8s.extensions.v1beta1.Ingress("ingresstest", {
metadata: {
annotations: {
'foo': "bar",
'computed-value': securityGroup.id,
"pulumi.com/skipAwait": "true"
}
},
spec: {
rules: [
{
http: {
paths: [{
backend: {
serviceName: "test",
servicePort: 8080
}
}]
}
}
]
}
}); "apiVersion": "v1",
"kind": "Pod",
"metadata": {
"annotations": {
"computed-value": "sg-09c7e02cbada2066a",
"foo": "bar",
"pulumi.com/autonamed": "true"
},
"creationTimestamp": "2019-02-20T16:36:27Z",
"labels": {
"app.kubernetes.io/managed-by": "pulumi"
},
"name": "podtest-bdktmpm5",
"namespace": "default",
"resourceVersion": "969710",
"selfLink": "/api/v1/namespaces/default/pods/podtest-bdktmpm5",
"uid": "ab1bf321-352d-11e9-acef-025000000001"
} |
Some further testing showed that simple annotations work fine on the preview; it's only when an annotation uses a computed value that they don't show up in the preview. For example: const pod = new k8s.core.v1.Pod("pod-test", {
metadata: {
annotations: {
"foo": "bar"
}
},
spec: {
containers: [
{name: "nginx", image: "nginx:1.13-alpine"},
],
},
}); When at least one annotation uses a computed value, only the const rand = new random.RandomString("rand", {length: 6});
const pod = new k8s.core.v1.Pod("pod-test", {
metadata: {
annotations: {
"random": rand.result,
"foo": "bar",
}
},
spec: {
containers: [
{name: "nginx", image: "nginx:1.13-alpine"},
],
},
}); |
Manually overriding the name, which prevents the const rand = new random.RandomString("rand", {length: 6});
const pod = new k8s.core.v1.Pod("pod-test", {
metadata: {
name: "foo",
annotations: {
"random": rand.result,
"foo": "bar",
}
},
spec: {
containers: [
{name: "nginx", image: "nginx:1.13-alpine"},
],
},
}); |
In the example below, the computed value for the aws security group within
metadata.annotations
causes all of the supplied annotations to disappear (including the plaintextfoo: bar
).Using
.apply
does not seem to work either.Expected behavior: Both
foo
and thecomputed-value
annotation should be present in the update preview.Current behavior: Only the
pulumi.com/autonamed
annotation is shown on previews.The text was updated successfully, but these errors were encountered: