{"record":{"id":"4eae6f6451e268b8","repo":"GoogleContainerTools/skaffold","slug":"skiptrim-value-not-set-s","errorCode":null,"errorMessage":"skipTrim value not set: %s","messagePattern":"skipTrim value not set: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/yamltags/tags.go","lineNumber":252,"sourceCode":"\t\tif !isZeroValue(field) {\n\t\t\treturn fmt.Errorf(\"only one element in set %s can be set. got %s and %s\", oot.setName, otherField, oot.Field.Name)\n\t\t}\n\t}\n\treturn nil\n}\n\ntype skipTrimTag struct {\n\tField reflect.StructField\n}\n\nfunc (tag *skipTrimTag) Load(s []string) error {\n\treturn nil\n}\n\nfunc (tag *skipTrimTag) Process(val reflect.Value) error {\n\tif isZeroValue(val) {\n\t\tif tags, ok := tag.Field.Tag.Lookup(\"yaml\"); ok {\n\t\t\treturn fmt.Errorf(\"skipTrim value not set: %s\", strings.Split(tags, \",\")[0])\n\t\t}\n\t\treturn fmt.Errorf(\"skipTrim value not set: %s\", tag.Field.Name)\n\t}\n\treturn nil\n}\n\nfunc isZeroValue(val reflect.Value) bool {\n\tif val.Kind() == reflect.Invalid {\n\t\treturn true\n\t}\n\tzv := reflect.Zero(val.Type()).Interface()\n\treturn reflect.DeepEqual(zv, val.Interface())\n}\n\nfunc init() {\n\tallOneOfs = make(map[string]map[string]fieldSet)\n}\n","sourceCodeStart":234,"sourceCodeEnd":270,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/yamltags/tags.go#L234-L270","documentation":"This error comes from the `skipTrim` yamltag validator in Skaffold's config reflection package. When a struct field marked with a `yaml:\"...,skipTrim\"` tag holds a zero value after parsing, Process() rejects it, reporting the field's yaml name (or Go field name if no yaml tag exists). It enforces that users of skipTrim fields always supply an explicit, non-zero value, because skipped/empty fields would otherwise be silently trimmed from output with unexpected semantics.","triggerScenarios":"Calling Process (directly or via skaffold's config validation walk) on a parsed Skaffold config struct whose field carrying the skipTrim yaml tag is a zero value (empty string, 0, false, nil, etc.), and the field's struct tag has a `yaml` tag whose first comma-separated token is used in the message.","commonSituations":"Users write a skaffold.yaml that omits a required field (or sets it to an empty value) where the Go config type marks that field skipTrim; happens after CLI schema changes make a previously optional field mandatory, or from hand-edited YAML leaving `key:` with nothing after the colon.","solutions":["Set a non-zero, explicit value for the reported yaml field in your skaffold.yaml.","Check the field name in the error message and consult the Skaffold schema docs for the current expected value/type.","If you are a Skaffold developer and the field should be optional, remove the skipTrim yamltag from the struct field.","If your code sets the field programmatically, ensure you assign it before running validation (e.g. default it in NewXxx constructors)."],"exampleFix":"// before (skaffold.yaml)\nbuild:\n  artifacts: []\n// after\nbuild:\n  artifacts:\n    - image: my-image\n      context: .","handlingStrategy":"validation","validationCode":"// validate the yaml field is set before processing\ntags, ok := field.Tag.Lookup(\"yaml\")\nname := field.Name\nif ok { name = strings.Split(tags, \",\")[0] }\nif val.IsZero() {\n    return fmt.Errorf(\"field %s marked skipTrim must be set\", name)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always populate skipTrim-marked fields in skaffold.yaml — never leave `key:` empty.","After editing YAML by hand, run `skaffold config` / `skaffold diagnose` to validate the schema.","Keep yaml struct tags correct when adding skipTrim in Go config types."],"tags":["yaml","config-validation","skaffold","reflection"],"backgroundTag":"missing-required-config-field","analyzedSha":"a1189de023efc32d4b8e11f395acc678aa555011","analyzedAt":"2026-09-05T12:09:27.064Z","contentChangedAt":"2026-09-05T12:09:27.064Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}