{"record":{"id":"67be12ebbbfabb1f","repo":"kubernetes/kops","slug":"linode-subnet-q-requires-a-name","errorCode":null,"errorMessage":"linode subnet %q requires a name","messagePattern":"linode subnet %q requires a name","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/model/linodemodel/network.go","lineNumber":49,"sourceCode":"}\n\nvar _ fi.CloudupModelBuilder = &NetworkModelBuilder{}\n\nfunc (b *NetworkModelBuilder) Build(c *fi.CloudupModelBuilderContext) error {\n\tif len(b.Cluster.Spec.Networking.Subnets) == 0 {\n\t\treturn fmt.Errorf(\"linode VPC requires at least one subnet\")\n\t}\n\n\tseenSubnetNames := map[string]string{}\n\tregion := \"\"\n\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}","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/model/linodemodel/network.go#L31-L67","documentation":"Linode NetworkModelBuilder.Build() iterates the cluster's subnets and validates each has a Name; a subnet spec with an empty name fails validation. The error message reports the placeholder name (\"subnet N\", index-based) generated for display when the name is empty.","triggerScenarios":"A cluster.spec.networking.subnets entry with name omitted or set to \"\" while region and CIDR are present — caught during kops create/update cluster for a Linode cluster.","commonSituations":"YAML manifest entries with the name key missing (e.g. only region/cidr filled); templating that drops empty fields; copy-paste of an AWS-style subnet entry relying on default naming that Linode does not support.","solutions":["Add a unique name to each subnet in cluster.spec.networking.subnets.","Use a name that remains valid after Linode label normalization (avoid special characters and excessive length).","Re-run kops update cluster after the fix."],"exampleFix":"// before\n- region: us-east\n  cidr: 10.0.0.0/24\n// after\n- name: us-east-1a\n  region: us-east\n  cidr: 10.0.0.0/24","handlingStrategy":"validation","validationCode":"for i, s := range cluster.Spec.Networking.Subnets {\n    if s.Name == \"\" {\n        return fmt.Errorf(\"subnet %d missing name\", i)\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Give every subnet an explicit, lowercase hyphenated name.","Lint manifests against the kops API schema before apply.","Avoid provider-specific defaults when porting specs to Linode.","Use kops toolbox template to render and inspect final subnets."],"tags":["linode","subnet","validation","configuration"],"backgroundTag":"subnet-name-required","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}