{"record":{"id":"bc2794f4ad6f49bd","repo":"kubernetes/kops","slug":"invalid-taint-spec-v-bc2794","errorCode":null,"errorMessage":"invalid taint spec: %v","messagePattern":"invalid taint spec: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/model/awsmodel/spotinst.go","lineNumber":1147,"sourceCode":"\t\t}\n\t\ttaints = append(taints, taint)\n\t}\n\n\treturn taints, nil\n}\n\nfunc parseTaint(taintSpec string) (*corev1.Taint, error) {\n\tvar taint corev1.Taint\n\n\tparts := strings.Split(taintSpec, \":\")\n\tswitch len(parts) {\n\tcase 1:\n\t\ttaint.Key = parts[0]\n\tcase 2:\n\t\ttaint.Effect = corev1.TaintEffect(parts[1])\n\t\tpartsKV := strings.Split(parts[0], \"=\")\n\t\tif len(partsKV) > 2 {\n\t\t\treturn nil, fmt.Errorf(\"invalid taint spec: %v\", taintSpec)\n\t\t}\n\t\ttaint.Key = partsKV[0]\n\t\tif len(partsKV) == 2 {\n\t\t\ttaint.Value = partsKV[1]\n\t\t}\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"invalid taint spec: %v\", taintSpec)\n\t}\n\n\treturn &taint, nil\n}\n\nfunc parseStringSlice(str string) ([]string, error) {\n\tv := strings.Split(str, \",\")\n\tfor i, s := range v {\n\t\tv[i] = strings.TrimSpace(s)\n\t}\n\treturn v, nil","sourceCodeStart":1129,"sourceCodeEnd":1165,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/model/awsmodel/spotinst.go#L1129-L1165","documentation":"parseTaint splits a taint spec on ':' and, for two-part specs (key=value:effect), further splits the key part on '='. This error is thrown when the key segment contains more than one '=' (len(partsKV) > 2), i.e. something like 'key=a=b:NoSchedule'. Only a single key=value pair is supported before the effect.","triggerScenarios":"parseTaints -> parseTaint receives a spec with an effect but the key portion contains two or more '=' characters, e.g. 'disk=ssd=true:NoSchedule' or a base64/URL value containing '=' placed in the key part.","commonSituations":"Users copy a kubectl-style taint but include an extra '=', or encode a value containing '=' (JWTs, base64) into the taint value without quoting/escaping.","solutions":["Remove the extra '=' — keep the form key=value:Effect with exactly one '=' before the colon.","If the value must contain '=', note this parser does not support it; choose a value without '=' or encode it in a '='-free form.","Validate each taint spec against the regex key=value:Effect before adding it to the cluster spec."],"exampleFix":"// before\nspotinst/taints: \"disk=ssd=true:NoSchedule\"\n// after\nspotinst/taints: \"disk=true:NoSchedule\"","handlingStrategy":"validation","validationCode":"func validTaintKV(spec string) bool {\n\tparts := strings.Split(spec, \":\")\n\tif len(parts) != 2 { return false }\n\treturn len(strings.Split(parts[0], \"=\")) <= 2\n}\n// validate each entry of the taints list before applying the spec","typeGuard":null,"tryCatchPattern":"if _, err := parseTaints(specs); err != nil {\n\treturn fmt.Errorf(\"taints invalid: %w\", err)\n}","preventionTips":["Keep taint specs in the exact form key=value:Effect with a single '='.","Never use values containing '=' (base64, JWTs) in taints.","Cross-check specs against `kubectl taint nodes` accepted syntax minus unsupported forms.","Add a CI lint step that regex-validates each taint entry."],"tags":["config","parsing","taints","spotinst"],"backgroundTag":"invalid-taint-spec","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"}