{"record":{"id":"3da57e942386b63b","repo":"GoogleContainerTools/skaffold","slug":"required-value-not-set-s","errorCode":null,"errorMessage":"required value not set: %s","messagePattern":"required value not set: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/yamltags/tags.go","lineNumber":176,"sourceCode":"}\n\ntype yamlTag interface {\n\tLoad([]string) error\n\tProcess(reflect.Value) error\n}\n\ntype requiredTag struct {\n\tField reflect.StructField\n}\n\nfunc (rt *requiredTag) Load(s []string) error {\n\treturn nil\n}\n\nfunc (rt *requiredTag) Process(val reflect.Value) error {\n\tif isZeroValue(val) {\n\t\tif tags, ok := rt.Field.Tag.Lookup(\"yaml\"); ok {\n\t\t\treturn fmt.Errorf(\"required value not set: %s\", strings.Split(tags, \",\")[0])\n\t\t}\n\t\treturn fmt.Errorf(\"required value not set: %s\", rt.Field.Name)\n\t}\n\treturn nil\n}\n\n// A program can have many structs, that each have many oneOfSets.\n// Each oneOfSet is a map of a oneOf-set name to the set of fields that belong to that oneOf-set\n// Only one field in that set may have a non-zero value.\n\nvar allOneOfs map[string]map[string]fieldSet\n\nfunc getOneOfSetsForStruct(structName string) map[string]fieldSet {\n\t_, ok := allOneOfs[structName]\n\tif !ok {\n\t\tallOneOfs[structName] = map[string]fieldSet{}\n\t}\n\treturn allOneOfs[structName]","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/yamltags/tags.go#L158-L194","documentation":"Skaffold's yamltags validation processes struct tags to enforce config correctness. A field marked `yaml:\"...,required\"` must not hold its zero value; requiredTag.Process returns 'required value not set' naming the yaml field name (falling back to the Go field name) when the parsed config leaves it empty.","triggerScenarios":"A skaffold.yaml (or any config decoded into yamltags-annotated structs) omits a field whose struct definition carries a `required` yaml tag, or explicitly sets it to the zero value (empty string, 0, nil), then config validation runs.","commonSituations":"Missing `deploy:` or `build:` subsection keys; a verify/test case without its `name`; copy-pasting an example but deleting a required key; a newly-added required field after upgrading Skaffold so old configs no longer validate.","solutions":["Set the missing field named in the message in skaffold.yaml (the name after 'required value not set:')","Run `skaffold config` / check `skaffold.yaml` against `skaffold init` or current schema docs","If the field genuinely has no value, restructure the config rather than passing an empty string","After a Skaffold upgrade, run `skaffold fix` to migrate old configs to the current schema"],"exampleFix":"// before (skaffold.yaml)\nverify:\n  - name: \"\"          # required value not set: name\n// after\nverify:\n  - name: my-integration-test\n    container:\n      image: gcr.io/k8s-skaffold/verify-runner","handlingStrategy":"validation","validationCode":"// validate skaffold.yaml against the schema before running\nfunc mustSet(m map[string]interface{}, key string) error {\n    v, ok := m[key]\n    if !ok || v == nil || v == \"\" {\n        return fmt.Errorf(\"required value not set: %s\", key)\n    }\n    return nil\n}","typeGuard":"func hasNonEmpty(s string) bool { return strings.TrimSpace(s) != \"\" }","tryCatchPattern":"if err := skaffoldCmd.Run(); err != nil {\n    if strings.Contains(err.Error(), \"required value not set\") {\n        // extract field name after ':' and prompt user to fill it in skaffold.yaml\n    }\n}","preventionTips":["After every Skaffold upgrade, run `skaffold fix` to migrate required fields","Validate skaffold.yaml against the current schema before CI runs","Start from `skaffold init` output rather than hand-writing configs","Grep the error's field name in skaffold.yaml and fill the empty key"],"tags":["config-validation","yaml","yamltags"],"backgroundTag":"missing-required-argument","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"}