Closed Ble4Ch closed 1 year ago
Thank you for reporting this, @Ble4Ch! This is indeed an oversight, but fortunately it will be fixed soon by #911.
Thanks for the quick replies and reviews. Did not have the time to work on a PR, great it's been resolved fast 🙏
@Ble4Ch, @rajiteh his fix is now released in version 0.31.1. Thank you for your report and PR!
What happened?
Hello there !
We can't update container node pool labels right now, when we have dots in the new labels, especially in the key (dots in value works as expected).
On an existing node pool, if we try to add a (node) label, like
key: "value"
, orkey: "value.dot"
, it works. But we can't add a label liketest.dot: "true"
We end up with an error like:error: failed to flatten keys for detailed diff: failed to lookup value at path "config.labels.test.dot" on new inputs
Expected Behavior
I expect the labels validator to follow the labels syntax, so that we can add labels like
test.dots/update: "true"
Steps to reproduce
Create a simple stack:
Update index.ts file with this one:
// Get some provider-namespaced configuration values const providerCfg = new pulumi.Config("gcp"); const gcpProject = providerCfg.require("project"); const gcpRegion = providerCfg.get("region") || "us-central1"; // Get some other configuration values or use defaults const cfg = new pulumi.Config(); const nodesPerZone = cfg.getNumber("nodesPerZone") || 1;
// Create a new network const gkeNetwork = new gcp.compute.Network("gke-network", { autoCreateSubnetworks: false, description: "A virtual network for your GKE cluster(s)", });
// Create a new subnet in the network created above const gkeSubnet = new gcp.compute.Subnetwork("gke-subnet", { ipCidrRange: "10.128.0.0/12", network: gkeNetwork.id, privateIpGoogleAccess: true, });
// Create a new GKE cluster const gkeCluster = new gcp.container.Cluster("gke-cluster", { addonsConfig: { dnsCacheConfig: { enabled: true, }, }, binaryAuthorization: { evaluationMode: "PROJECT_SINGLETON_POLICY_ENFORCE", }, datapathProvider: "ADVANCED_DATAPATH", description: "A GKE cluster", initialNodeCount: 1, ipAllocationPolicy: { clusterIpv4CidrBlock: "/14", servicesIpv4CidrBlock: "/20", }, location: gcpRegion, masterAuthorizedNetworksConfig: { cidrBlocks: [{ cidrBlock: "0.0.0.0/0", displayName: "All networks", }], }, network: gkeNetwork.name, networkingMode: "VPC_NATIVE", privateClusterConfig: { enablePrivateNodes: true, enablePrivateEndpoint: false, masterIpv4CidrBlock: "10.100.0.0/28", }, removeDefaultNodePool: true, releaseChannel: { channel: "STABLE", }, subnetwork: gkeSubnet.name, workloadIdentityConfig: { workloadPool:
${gcpProject}.svc.id.goog
, }, });const labels: { [id: string]: string } = {
}
// Create a nodepool for the GKE cluster const gkeNodepool = new gnative.container.v1.NodePool("gke-nodepool", { name: "test", clusterId: gkeCluster.name, initialNodeCount: nodesPerZone, config: { labels: labels, }, });
// Export some values for use elsewhere export const networkName = gkeNetwork.name; export const networkId = gkeNetwork.id; export const clusterName = gkeCluster.name; export const clusterId = gkeCluster.id;
pulumi up
const labels: { [id: string]: string } = {
}
pulumi preview
Additional context
I think the root cause is somewhere in this function
Contributing
Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).