GoogleContainerTools/skaffold · error

can't merge disableValidation property from kustomize into k

Error message

can't merge disableValidation property from kustomize into kubectl deployer, property is already set with different value

What it means

Same merge as the defaultNamespace conflict: when merging a kustomize deployer into a kubectl deployer during upgrade, disagreeing `disableValidation` flags make the result ambiguous, so the upgrade returns this error.

Source

Thrown at pkg/skaffold/schema/v2beta29/upgrade.go:331

		}
	}
}

func mergeKustomizeIntoKubectlDeployer(newPL *next.Pipeline, oldPL *Pipeline) error {
	kustomizeD := &next.KubectlDeploy{}
	pkgutil.CloneThroughJSON(oldPL.Deploy.KustomizeDeploy, kustomizeD)

	if newPL.Deploy.KubectlDeploy == nil {
		newPL.Deploy.KubectlDeploy = kustomizeD
	} else {
		kubectlD := newPL.Deploy.KubectlDeploy

		if kubectlD.DefaultNamespace != nil && kustomizeD.DefaultNamespace != nil && *(kubectlD.DefaultNamespace) != *(kustomizeD.DefaultNamespace) {
			return errors.New("can't merge defaultNamespace property from kustomize into kubectl deployer, property is already set with different value")
		}

		if kubectlD.Flags.DisableValidation != kustomizeD.Flags.DisableValidation {
			return errors.New("can't merge disableValidation property from kustomize into kubectl deployer, property is already set with different value")
		}

		if kustomizeD.DefaultNamespace != nil {
			kubectlD.DefaultNamespace = kustomizeD.DefaultNamespace
		}

		kubectlD.Flags = next.KubectlFlags{
			DisableValidation: kustomizeD.Flags.DisableValidation,
			Global:            append(kubectlD.Flags.Global, kustomizeD.Flags.Global...),
			Apply:             append(kubectlD.Flags.Apply, kustomizeD.Flags.Apply...),
			Delete:            append(kubectlD.Flags.Delete, kustomizeD.Flags.Delete...),
		}

		kubectlD.LifecycleHooks = next.DeployHooks{
			PreHooks:  append(kubectlD.LifecycleHooks.PreHooks, kustomizeD.LifecycleHooks.PreHooks...),
			PostHooks: append(kubectlD.LifecycleHooks.PostHooks, kustomizeD.LifecycleHooks.PostHooks...),
		}
	}

View on GitHub (pinned to a1189de023)

Solutions

  1. Set the same disableValidation value on both deployers before upgrading.
  2. Remove the flags.disableValidation from one deployer so only one value exists.
  3. Skip the pre-merge by removing the kustomize deployer (its settings merge cleanly otherwise).

Example fix

# before
kustomize:
  flags:
    disableValidation: true
kubectl:
  flags:
    disableValidation: false
# after
kubectl:
  flags:
    disableValidation: true
Defensive patterns

Strategy: validation

Validate before calling

func flagConflict(k, ku *v2beta29.KubectlDeploy) bool {
    return k != nil && ku != nil && k.Flags.DisableValidation != ku.Flags.DisableValidation
}

Type guard

if kd.Flags.DisableValidation != kzd.Flags.DisableValidation { /* conflict */ }

Try / catch

if err != nil && strings.Contains(err.Error(), "can't merge disableValidation") {
    // set equal flags or drop one, then retry upgrade
}

Prevention

When it happens

Trigger: Upgrading a config where deploy.kubectl.flags.disableValidation and deploy.kustomize.flags.disableValidation are both set to different boolean values.

Common situations: Users who disabled validation for one deployer but not the other, then run `skaffold fix` on a multi-deployer config.

Related errors


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