{"record":{"id":"67dc9c9760906c3d","repo":"kubernetes/kops","slug":"linode-subnet-q-requires-a-cidr","errorCode":null,"errorMessage":"linode subnet %q requires a CIDR","messagePattern":"linode subnet %q requires a CIDR","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/model/linodemodel/network.go","lineNumber":55,"sourceCode":"\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}\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())","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/model/linodemodel/network.go#L37-L73","documentation":"Linode NetworkModelBuilder.Build() validates that every subnet defines a CIDR block, which is required to create the Linode VPC subnet. An empty subnet.CIDR fails validation with this error, reported under the subnet's name.","triggerScenarios":"A cluster.spec.networking.subnets entry with name and region set but cidr omitted, empty, or under a wrong key (e.g. cidrBlock instead of cidr).","commonSituations":"Manifests copied from providers with different CIDR field names; templating leaving the cidr variable unsubstituted; hand-edited specs where the CIDR line was deleted.","solutions":["Set cidr on each subnet in cluster.spec.networking.subnets (e.g. 10.0.0.0/24).","Verify the YAML key is cidr per the kops v1alpha2/v1beta1 API, not cidrBlock.","Ensure the CIDR does not overlap other subnets in the cluster VPC.","Re-run kops update cluster after fixing."],"exampleFix":"// before\n- name: us-east-1a\n  region: us-east\n// after\n- name: us-east-1a\n  region: us-east\n  cidr: 10.0.0.0/24","handlingStrategy":"validation","validationCode":"for _, s := range cluster.Spec.Networking.Subnets {\n    if s.CIDR == \"\" {\n        return fmt.Errorf(\"subnet %q missing cidr\", s.Name)\n    }\n    if _, _, err := net.ParseCIDR(s.CIDR); err != nil {\n        return fmt.Errorf(\"subnet %q has invalid cidr %q\", s.Name, s.CIDR)\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set a valid CIDR (net.ParseCIDR-checkable) on every subnet.","Ensure subnets do not overlap within the cluster.","Use the kops API field name cidr, not provider-specific variants.","Dry-run cluster creation to validate networking before apply."],"tags":["linode","subnet","cidr","validation"],"backgroundTag":"subnet-cidr-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"}