{"record":{"id":"d4e9f2f99fa73a76","repo":"kubernetes/kops","slug":"error-parsing-version-s-v","errorCode":null,"errorMessage":"Error parsing version %s: %v","messagePattern":"Error parsing version (.+?): (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/apis/kops/cluster.go","lineNumber":894,"sourceCode":"\treturn nil\n}\n\n// SharedVPC is a simple helper function which makes the templates for a shared VPC clearer\nfunc (c *Cluster) SharedVPC() bool {\n\treturn c.Spec.Networking.NetworkID != \"\"\n}\n\n// IsKubernetesGTE checks if the version is >= the specified version.\n// It panics if the kubernetes version in the cluster is invalid, or if the version is invalid.\nfunc (c *Cluster) IsKubernetesGTE(version string) bool {\n\tclusterVersion, err := util.ParseKubernetesVersion(c.Spec.KubernetesVersion)\n\tif err != nil || clusterVersion == nil {\n\t\tpanic(fmt.Sprintf(\"error parsing cluster spec.kubernetesVersion %q\", c.Spec.KubernetesVersion))\n\t}\n\n\tparsedVersion, err := util.ParseKubernetesVersion(version)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"Error parsing version %s: %v\", version, err))\n\t}\n\n\t// Ignore Pre & Build fields\n\tclusterVersion.Pre = nil\n\tclusterVersion.Build = nil\n\n\treturn clusterVersion.GTE(*parsedVersion)\n}\n\n// IsKubernetesLT checks if the version is < the specified version.\n// It panics if the kubernetes version in the cluster is invalid, or if the version is invalid.\nfunc (c *Cluster) IsKubernetesLT(version string) bool {\n\treturn !c.IsKubernetesGTE(version)\n}\n\n// IsSharedAzureResourceGroup returns true if the resource group is shared.\nfunc (c *Cluster) IsSharedAzureResourceGroup() bool {\n\treturn c.Spec.CloudProvider.Azure.ResourceGroupName != \"\"","sourceCodeStart":876,"sourceCodeEnd":912,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/apis/kops/cluster.go#L876-L912","documentation":"Panicked from Cluster.IsKubernetesGTE when the version argument passed to the GTE comparison itself fails to parse — distinct from the cluster-version panic, this fires when the caller-supplied comparison string (e.g. \"1.27\" style or a typo like \"v1.x\") is not valid semver. The helper's contract panics on invalid input so the offending version string is printed with the parse error.","triggerScenarios":"Thrown at pkg/apis/kops/cluster.go:894 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a fully-qualified valid version (e.g. \"1.27.0\", not \"1.27\") to IsKubernetesGTE","Fix the hardcoded version constant at the call site reported by the panic"],"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"}