{"record":{"id":"c1ff180d64106ffc","repo":"kubernetes/kops","slug":"linode-vpc-requires-at-least-one-subnet","errorCode":null,"errorMessage":"linode VPC requires at least one subnet","messagePattern":"linode VPC requires at least one subnet","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/model/linodemodel/network.go","lineNumber":37,"sourceCode":"import (\n\t\"fmt\"\n\n\t\"k8s.io/kops/upup/pkg/fi\"\n\t\"k8s.io/kops/upup/pkg/fi/cloudup/linode\"\n\t\"k8s.io/kops/upup/pkg/fi/cloudup/linodetasks\"\n)\n\n// NetworkModelBuilder configures the Akamai (Linode) VPC for the cluster.\ntype NetworkModelBuilder struct {\n\t*LinodeModelContext\n\tLifecycle fi.Lifecycle\n}\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)","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/model/linodemodel/network.go#L19-L55","documentation":"The Linode NetworkModelBuilder.Build() validates the cluster's networking configuration before generating VPC/subnet tasks. Linode clusters require at least one subnet defined in cluster.spec.networking.subnets; if the list is empty, the build aborts with this static error.","triggerScenarios":"Creating or updating a Linode cluster whose manifest omits spec.networking.subnets entirely, or after a spec edit/tooling pass stripped the subnets array.","commonSituations":"Hand-written cluster manifests missing the subnets section; kops toolbox template rendering producing empty subnets; migrating a cluster spec from a provider where subnets are optional.","solutions":["Add at least one subnet to cluster.spec.networking.subnets with name, region, and CIDR set.","Re-run kops update cluster --yes after fixing the manifest.","If using a cluster template, verify the templating filled in the subnets section."],"exampleFix":"// before\nnetworking:\n  subnets: []\n// after\nnetworking:\n  subnets:\n  - name: us-east-1a\n    region: us-east\n    cidr: 10.0.0.0/24","handlingStrategy":"validation","validationCode":"if len(cluster.Spec.Networking.Subnets) == 0 {\n    return errors.New(\"cluster.spec.networking.subnets must define at least one subnet for Linode\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always define at least one subnet with name/region/cidr for Linode clusters.","Run kops validate or a schema check on the manifest before create.","Verify templating outputs a non-empty subnets list.","Re-check specs after automated edits or migrations."],"tags":["linode","network","subnet","validation"],"backgroundTag":"missing-subnet-configuration","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"}