GoogleContainerTools/skaffold · error
conflicting sets of kubectl deploy flags not supported in `s
Error message
conflicting sets of kubectl deploy flags not supported in `skaffold apply` (flag: %s)
What it means
`skaffold apply` merges CLI kubectl flags with those in skaffold.yaml and rejects conflicting values. This instance fires when the DisableValidation boolean differs between the CLI flag set and the config flag set.
Source
Thrown at pkg/skaffold/runner/deployer.go:305
if kFlags == nil {
kFlags = &latest.KubectlFlags{}
}
k := &latest.KubectlDeploy{
Flags: *kFlags,
DefaultNamespace: defaultNamespace,
}
dCtx := &deployerCtx{runCtx, latest.DeployConfig{StatusCheck: statusCheck, KubeContext: kubeContext, DeployType: latest.DeployType{KubectlDeploy: k}}}
defaultDeployer, err := kubectl.NewDeployer(dCtx, labeller, k, runCtx.Artifacts(), "", selectors)
if err != nil {
return nil, fmt.Errorf("instantiating default kubectl deployer: %w", err)
}
return defaultDeployer, nil
}
func validateKubectlFlags(flags *latest.KubectlFlags, additional latest.KubectlFlags) error {
errStr := "conflicting sets of kubectl deploy flags not supported in `skaffold apply` (flag: %s)"
if additional.DisableValidation != flags.DisableValidation {
return fmt.Errorf(errStr, strconv.FormatBool(additional.DisableValidation))
}
for _, flag := range additional.Apply {
if !stringslice.Contains(flags.Apply, flag) {
return fmt.Errorf(errStr, flag)
}
}
for _, flag := range additional.Delete {
if !stringslice.Contains(flags.Delete, flag) {
return fmt.Errorf(errStr, flag)
}
}
for _, flag := range additional.Global {
if !stringslice.Contains(flags.Global, flag) {
return fmt.Errorf(errStr, flag)
}
}
return nil
}View on GitHub (pinned to a1189de023)
Solutions
- Remove the conflicting --disable-validation CLI flag or the disableValidation entry from skaffold.yaml so both agree
- If CLI intent should win, delete the flag from deploy.kubectl.flags in skaffold.yaml
- Check the reported flag value in the message to see which side conflicts
Example fix
// before (skaffold.yaml)
deploy:
kubectl:
flags:
disableValidation: true
// after — either remove it, or pass matching flag
skaffold apply --disable-validation Defensive patterns
Strategy: validation
Validate before calling
if ((cliFlags.disableValidation ?? cfgFlags.disableValidation ?? false) !== (cfgFlags.disableValidation ?? false))
throw new Error('disableValidation differs between CLI and skaffold.yaml') Type guard
function flagsMatch(cli, cfg) {
return (cli.disableValidation ?? false) === (cfg.disableValidation ?? false)
} Try / catch
if err := validateKubectlFlags(configFlags, cliFlags); err != nil {
return fmt.Errorf("align skaffold.yaml deploy.kubectl.flags with CLI: %w", err)
} Prevention
- Define kubectl flags only in skaffold.yaml, keep CLI plain
- Grep CI scripts for --disable-validation mismatches
- Keep flag sets identical across environments
When it happens
Trigger: validateKubectlFlags: additional.DisableValidation != flags.DisableValidation, i.e. `--disable-validation` given on the command line (or defaults) disagrees with deploy.kubectl.flags.disableValidation in skaffold.yaml.
Common situations: Setting disableValidation: true in skaffold.yaml while passing --disable-validation=false (or omitting it) on `skaffold apply`; CI scripts adding flags the config doesn't declare.
Related errors
- can't merge disableValidation property from kustomize into k
- kubectl apply: %w
- cannot add an empty image value
- value must be one of `always`, `missing`, or `never`
- kubectl version 1.12.0 or greater is recommended for use wit
AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05).
Data as JSON: /api/errors/ba455749a18525bc.
Report an issue: GitHub.