{"record":{"id":"c0d0f1d9195724c6","repo":"kubernetes/kops","slug":"linode-subnet-q-requires-a-region","errorCode":null,"errorMessage":"linode subnet %q requires a region","messagePattern":"linode subnet %q requires a region","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/model/linodemodel/network.go","lineNumber":52,"sourceCode":"\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}\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}","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/model/linodemodel/network.go#L34-L70","documentation":"Linode NetworkModelBuilder.Build() requires each cluster subnet to specify a Region, since Linode subnets/VPCs are region-scoped and instances are placed by region. An empty subnet.Region fails validation with this error, reported under the subnet's display name.","triggerScenarios":"A cluster.spec.networking.subnets entry for a Linode cluster with name and CIDR set but region empty or misspelled key (e.g. zones instead of region).","commonSituations":"Porting an AWS cluster spec where region is cluster-level rather than per-subnet; typos in YAML keys; template variables that failed to substitute the region value.","solutions":["Set region on each subnet in cluster.spec.networking.subnets to a valid Linode region (e.g. us-east).","Confirm the YAML key is region, not zone or location.","Ensure all subnets use the same region — the builder enforces a single region per Linode cluster.","Re-run kops update cluster after fixing."],"exampleFix":"// before\n- name: us-east-1a\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.Region == \"\" {\n        return fmt.Errorf(\"subnet %q missing region\", s.Name)\n    }\n}\n// also confirm all regions are identical\nseen := map[string]bool{}\nfor _, s := range cluster.Spec.Networking.Subnets {\n    seen[s.Region] = true\n}\nif len(seen) > 1 {\n    return errors.New(\"all Linode subnets must be in the same region\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set region per subnet; Linode does not use a cluster-level region like AWS.","Use valid Linode region slugs (e.g. us-east, eu-central).","Keep all subnets in a single region for one Linode cluster.","Check YAML keys carefully when porting from other providers."],"tags":["linode","subnet","region","validation"],"backgroundTag":"subnet-region-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"}