{"record":{"id":"16bf9fdfcc89c408","repo":"GoogleContainerTools/skaffold","slug":"unknown-update-strategy-q","errorCode":null,"errorMessage":"unknown update strategy %q","messagePattern":"unknown update strategy %q","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/render/kptfile/pipeline_type.go","lineNumber":84,"sourceCode":"\tGitOrigin OriginType = \"git\"\n)\n\n// UpdateStrategyType defines the strategy for updating a package from upstream.\ntype UpdateStrategyType string\n\n// ToUpdateStrategy takes a string representing an update strategy and will\n// return the strategy as an UpdateStrategyType. If the provided string does\n// not match any known update strategies, an error will be returned.\nfunc ToUpdateStrategy(strategy string) (UpdateStrategyType, error) {\n\tswitch strategy {\n\tcase string(ResourceMerge):\n\t\treturn ResourceMerge, nil\n\tcase string(FastForward):\n\t\treturn FastForward, nil\n\tcase string(ForceDeleteReplace):\n\t\treturn ForceDeleteReplace, nil\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"unknown update strategy %q\", strategy)\n\t}\n}\n\nconst (\n\t// ResourceMerge performs a structural schema-aware comparison and\n\t// merges the changes into the local package.\n\tResourceMerge UpdateStrategyType = \"resource-merge\"\n\t// FastForward fails without updating if the local package was modified\n\t// since it was fetched.\n\tFastForward UpdateStrategyType = \"fast-forward\"\n\t// ForceDeleteReplace wipes all local changes to the package.\n\tForceDeleteReplace UpdateStrategyType = \"force-delete-replace\"\n)\n\n// UpdateStrategies is a slice with all the supported update strategies.\nvar UpdateStrategies = []UpdateStrategyType{\n\tResourceMerge,\n\tFastForward,","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/render/kptfile/pipeline_type.go#L66-L102","documentation":"ToUpdateStrategy converts a string from a Kptfile pipeline update strategy into the typed UpdateStrategy enum (ResourceMerge, FastForward, ForceDeleteReplace, etc.). If the string matches no known strategy, it returns 'unknown update strategy %q'. This validates the Kptfile contents during render.","triggerScenarios":"A Kptfile declares an update strategy string (pipeline.update-strategy or setter strategies) not in the enum — e.g. a typo, a strategy added in a newer kpt version, or a removed/renamed strategy — and ToUpdateStrategy is called on it.","commonSituations":"Hand-edited Kptfile with misspelled strategy (e.g. 'resource-merge' vs 'ResourceMerge' casing per the constant strings); Kptfile generated by a newer kpt CLI using a strategy this Skaffold version doesn't know; copy-pasted strategy name from docs for a different tool.","solutions":["Check the strategy string in the Kptfile against the constants in pkg/skaffold/render/kptfile/pipeline_type.go and fix casing/spelling","Use a known strategy: ResourceMerge, FastForward, or ForceDeleteReplace","If the Kptfile came from a newer kpt, either change the strategy or upgrade Skaffold to a version that supports it","Run kpt pkg update / regenerate the Kptfile with a compatible kpt version"],"exampleFix":"// before (Kptfile)\nupdateStrategy: resource_merge\n// after\nupdateStrategy: ResourceMerge","handlingStrategy":"validation","validationCode":"yq '.pipeline.update.strategy' Kptfile | grep -E '^(ResourceMerge|FastForward|ForceDeleteReplace)$' || echo 'unknown strategy in Kptfile'","typeGuard":null,"tryCatchPattern":"strategy, err := kptfile.ToUpdateStrategy(s)\nif err != nil {\n    // log the rejected %q value, fall back to ResourceMerge or correct the Kptfile\n}","preventionTips":["Only use strategy names defined in pkg/skaffold/render/kptfile/pipeline_type.go","Regenerate Kptfiles with a kpt version compatible with your Skaffold","Pin kpt and Skaffold versions in CI to avoid schema drift"],"tags":["kptfile","validation","enum","configuration"],"backgroundTag":"invalid-enum-value","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"}