GoogleContainerTools/skaffold · error

unknown update strategy %q

Error message

unknown update strategy %q

What it means

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.

Source

Thrown at pkg/skaffold/render/kptfile/pipeline_type.go:84

	GitOrigin OriginType = "git"
)

// UpdateStrategyType defines the strategy for updating a package from upstream.
type UpdateStrategyType string

// ToUpdateStrategy takes a string representing an update strategy and will
// return the strategy as an UpdateStrategyType. If the provided string does
// not match any known update strategies, an error will be returned.
func ToUpdateStrategy(strategy string) (UpdateStrategyType, error) {
	switch strategy {
	case string(ResourceMerge):
		return ResourceMerge, nil
	case string(FastForward):
		return FastForward, nil
	case string(ForceDeleteReplace):
		return ForceDeleteReplace, nil
	default:
		return "", fmt.Errorf("unknown update strategy %q", strategy)
	}
}

const (
	// ResourceMerge performs a structural schema-aware comparison and
	// merges the changes into the local package.
	ResourceMerge UpdateStrategyType = "resource-merge"
	// FastForward fails without updating if the local package was modified
	// since it was fetched.
	FastForward UpdateStrategyType = "fast-forward"
	// ForceDeleteReplace wipes all local changes to the package.
	ForceDeleteReplace UpdateStrategyType = "force-delete-replace"
)

// UpdateStrategies is a slice with all the supported update strategies.
var UpdateStrategies = []UpdateStrategyType{
	ResourceMerge,
	FastForward,

View on GitHub (pinned to a1189de023)

Solutions

  1. Check the strategy string in the Kptfile against the constants in pkg/skaffold/render/kptfile/pipeline_type.go and fix casing/spelling
  2. Use a known strategy: ResourceMerge, FastForward, or ForceDeleteReplace
  3. If the Kptfile came from a newer kpt, either change the strategy or upgrade Skaffold to a version that supports it
  4. Run kpt pkg update / regenerate the Kptfile with a compatible kpt version

Example fix

// before (Kptfile)
updateStrategy: resource_merge
// after
updateStrategy: ResourceMerge
Defensive patterns

Strategy: validation

Validate before calling

yq '.pipeline.update.strategy' Kptfile | grep -E '^(ResourceMerge|FastForward|ForceDeleteReplace)$' || echo 'unknown strategy in Kptfile'

Try / catch

strategy, err := kptfile.ToUpdateStrategy(s)
if err != nil {
    // log the rejected %q value, fall back to ResourceMerge or correct the Kptfile
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05). Data as JSON: /api/errors/16bf9fdfcc89c408. Report an issue: GitHub.