{"record":{"id":"e9a3840891a9e2e7","repo":"kubernetes/kops","slug":"linode-subnets-q-and-q-normalize-to-the-same-lab","errorCode":null,"errorMessage":"linode subnets %q and %q normalize to the same label %q","messagePattern":"linode subnets %q and %q normalize to the same label %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/model/linodemodel/network.go","lineNumber":60,"sourceCode":"\tfor i, subnet := range b.Cluster.Spec.Networking.Subnets {\n\t\tsubnetName := subnet.Name\n\t\tif subnetName == \"\" {\n\t\t\tsubnetName = fmt.Sprintf(\"subnet %d\", i)\n\t\t}\n\n\t\tif subnet.Name == \"\" {\n\t\t\treturn fmt.Errorf(\"linode subnet %q requires a name\", subnetName)\n\t\t}\n\t\tif subnet.Region == \"\" {\n\t\t\treturn fmt.Errorf(\"linode subnet %q requires a region\", subnetName)\n\t\t}\n\t\tif subnet.CIDR == \"\" {\n\t\t\treturn fmt.Errorf(\"linode subnet %q requires a CIDR\", subnetName)\n\t\t}\n\n\t\tnormalizedSubnetName := linode.NormalizeLinodeLabel(b.ClusterName() + \"-\" + subnet.Name)\n\t\tif previousSubnetName, found := seenSubnetNames[normalizedSubnetName]; found {\n\t\t\treturn fmt.Errorf(\"linode subnets %q and %q normalize to the same label %q\", previousSubnetName, subnetName, normalizedSubnetName)\n\t\t}\n\t\tseenSubnetNames[normalizedSubnetName] = subnetName\n\n\t\tif region == \"\" {\n\t\t\tregion = subnet.Region\n\t\t\tcontinue\n\t\t}\n\t\tif subnet.Region != region {\n\t\t\treturn fmt.Errorf(\"linode subnets must all use the same region; found %q and %q\", region, subnet.Region)\n\t\t}\n\t}\n\n\tname := linode.NormalizeLinodeLabel(b.ClusterName())\n\tdescription := fmt.Sprintf(\"kOps VPC for %s\", b.ClusterName())\n\tvpcTask := &linodetasks.VPC{\n\t\tName:        new(name),\n\t\tLifecycle:   b.Lifecycle,\n\t\tDescription: new(description),","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/model/linodemodel/network.go#L42-L78","documentation":"Linode resource labels have strict character rules, so kOps normalizes each subnet label as NormalizeLinodeLabel(clusterName + \"-\" + subnetName). If two distinct subnets normalize to the same label, tasks would collide and the build aborts with this error identifying the two subnet names and the shared label.","triggerScenarios":"Two cluster.spec.networking.subnets entries whose names differ only in characters stripped/replaced by Linode label normalization (e.g. \"us_east_1a\" vs \"us-east-1a\"), or names so long that truncation to Linode's label limit makes them identical.","commonSituations":"Subnet names using underscores/dots/uppercase that normalize to the same hyphenated form; very long cluster+subnet names truncated identically; duplicated subnet entries with trivially different names.","solutions":["Rename the subnets with clearly distinct, short, lowercase hyphenated names (e.g. us-east-1a, us-east-1b).","Shorten the cluster name or subnet names so normalized labels stay within Linode's 64-char limit without truncation collisions.","Precompute NormalizeLinodeLabel(clusterName + \"-\" + subnetName) for all subnets and confirm uniqueness before applying.","Update the InstanceGroups to reference the renamed subnets and re-run kops update cluster."],"exampleFix":"// before\nsubnets:\n- name: us_east_1a\n- name: us-east-1a   # normalizes to the same label\n// after\nsubnets:\n- name: us-east-1a\n- name: us-east-1b","handlingStrategy":"validation","validationCode":"seen := map[string]string{}\nfor _, s := range cluster.Spec.Networking.Subnets {\n    label := linode.NormalizeLinodeLabel(clusterName + \"-\" + s.Name)\n    if prev, ok := seen[label]; ok {\n        return fmt.Errorf(\"subnets %q and %q collide on label %q\", prev, s.Name, label)\n    }\n    seen[label] = s.Name\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Choose short, distinct, lowercase-hyphenated subnet names.","Keep cluster name short enough that normalized labels fit Linode's 64-char limit.","Pre-normalize and check uniqueness of all resource labels before apply.","Avoid underscore/dot variants of the same name in one cluster spec."],"tags":["linode","subnet","naming","label-normalization"],"backgroundTag":"duplicate-resource-label","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}