{"record":{"id":"9319bebb475ee129","repo":"GoogleContainerTools/skaffold","slug":"unknown-tagger-for-strategy-v","errorCode":null,"errorMessage":"unknown tagger for strategy %+v","messagePattern":"unknown tagger for strategy %\\+v","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/tag/tagger_mux.go","lineNumber":88,"sourceCode":"\n\tcase t.DateTimeTagger != nil:\n\t\treturn NewDateTimeTagger(t.DateTimeTagger.Format, t.DateTimeTagger.TimeZone), nil\n\n\tcase t.InputDigest != nil:\n\t\tgraph := graph.ToArtifactGraph(runCtx.Artifacts())\n\t\treturn NewInputDigestTagger(runCtx, graph)\n\n\tcase t.CustomTemplateTagger != nil:\n\t\tcomponents, err := CreateComponents(runCtx, t.CustomTemplateTagger)\n\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"creating components: %w\", err)\n\t\t}\n\n\t\treturn NewCustomTemplateTagger(runCtx, t.CustomTemplateTagger.Template, components)\n\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unknown tagger for strategy %+v\", t)\n\t}\n}\n\n// CreateComponents creates a map of taggers for CustomTemplateTagger\nfunc CreateComponents(runCtx *runcontext.RunContext, t *latest.CustomTemplateTagger) (map[string]Tagger, error) {\n\tcomponents := map[string]Tagger{}\n\n\tfor _, taggerComponent := range t.Components {\n\t\tname, c := taggerComponent.Name, taggerComponent.Component\n\n\t\tif _, ok := components[name]; ok {\n\t\t\treturn nil, fmt.Errorf(\"multiple components with name %s\", name)\n\t\t}\n\n\t\tswitch {\n\t\tcase c.EnvTemplateTagger != nil:\n\t\t\tcomponents[name], _ = NewEnvTemplateTagger(c.EnvTemplateTagger.Template)\n","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/tag/tagger_mux.go#L70-L106","documentation":"getTagger switches over the fields of the latest.TagPolicy struct; if none of the known strategy pointers (sha256, envTemplate, gitCommit, dateTime, inputDigest, customTemplate) is set, it falls through to the default case and reports the whole policy as unknown. Skaffold cannot pick a tagging implementation for an empty or unrecognized policy.","triggerScenarios":"A Build.TagPolicy value where no strategy field is populated (e.g. tagPolicy: {} or a policy struct constructed programmatically without setting any oneof member), passed to getTagger via NewTaggerMux.","commonSituations":"Empty tagPolicy in skaffold.yaml; partial profile merges that clear the tag policy; constructing latest.TagProfile programmatically and forgetting to set a strategy; YAML key typos so the field lands nowhere.","solutions":["Set exactly one tag strategy in tagPolicy, e.g. tagPolicy: {sha256: {}}","Check for YAML typos in the tagPolicy key name (must be a recognized strategy)","If building TagPolicy in code, assign one of the oneof strategy fields"],"exampleFix":"// before\nbuild:\n  tagPolicy: {}\n\n// after\nbuild:\n  tagPolicy:\n    sha256: {}","handlingStrategy":"validation","validationCode":"func hasTagStrategy(tp latest.TagPolicy) bool {\n    return tp.Sha256Tagger != nil || tp.EnvTemplateTagger != nil ||\n        tp.GitTagger != nil || tp.DateTimeTagger != nil ||\n        tp.InputDigest != nil || tp.CustomTemplateTagger != nil\n}\n// reject configs where hasTagStrategy(p.Build.TagPolicy) == false","typeGuard":null,"tryCatchPattern":"t, err := tag.NewTaggerMux(runCtx)\nif err != nil && strings.Contains(err.Error(), \"unknown tagger for strategy\") {\n    return fmt.Errorf(\"config error: set a tagPolicy strategy (e.g. sha256): %w\", err)\n}","preventionTips":["Always set exactly one tagPolicy strategy in skaffold.yaml","Avoid programmatic TagPolicy construction without a oneof member","Check YAML indentation so strategy keys parse into the right struct field"],"tags":["skaffold","tagging","config"],"backgroundTag":"unknown-tag-strategy","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"}