{"record":{"id":"fed8ddaa95d15306","repo":"kubernetes/kops","slug":"unknown-mode-q-for-network","errorCode":null,"errorMessage":"unknown mode %q for Network","messagePattern":"unknown mode %q for Network","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/gcetasks/network.go","lineNumber":134,"sourceCode":"\t\tif cidr != \"\" {\n\t\t\treturn fmt.Errorf(\"CIDR cannot specified for networks where mode=%s\", e.Mode)\n\t\t}\n\t}\n\n\tswitch e.Mode {\n\tcase \"auto\":\n\tcase \"custom\":\n\tcase \"legacy\":\n\t\t// Known\n\n\tcase \"\":\n\t\t// Treated as \"keep existing\", only allowed for shared mode\n\t\tif !fi.ValueOf(e.Shared) {\n\t\t\treturn fmt.Errorf(\"must specify mode for (non-shared) Network\")\n\t\t}\n\n\tdefault:\n\t\treturn fmt.Errorf(\"unknown mode %q for Network\", e.Mode)\n\t}\n\n\treturn nil\n}\n\nfunc (_ *Network) RenderGCE(t *gce.GCEAPITarget, a, e, changes *Network) error {\n\tshared := fi.ValueOf(e.Shared)\n\tif shared {\n\t\t// Verify the network was found\n\t\tif a == nil {\n\t\t\treturn fmt.Errorf(\"Network with name %q not found\", fi.ValueOf(e.Name))\n\t\t}\n\t}\n\n\tif a == nil {\n\t\tklog.V(2).Infof(\"Creating Network with CIDR: %q\", fi.ValueOf(e.CIDR))\n\n\t\tnetwork := &compute.Network{","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/gcetasks/network.go#L116-L152","documentation":"Validation error from Network.CheckChanges. The Mode string on the network spec matches none of the accepted values (auto, custom, legacy, or empty-for-shared); the offending mode is printed. Guards against typos in the spec reaching the GCE API.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/gcetasks/network.go:134 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Correct the mode in the network spec to one of: auto, custom, or legacy","Leave mode empty only when adopting a pre-existing shared network"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}