GoogleContainerTools/skaffold · warning
kubectl version 1.12.0 or greater is recommended for use wit
Error message
kubectl version 1.12.0 or greater is recommended for use with Skaffold
What it means
CheckVersion validates the installed kubectl client version and returns this error when kubectl is older than 1.12, which Skaffold considers the minimum recommended version for manifest handling. CompareVersionTo compares the client's major/minor version against 1.12 and a negative result triggers the message.
Source
Thrown at pkg/skaffold/kubectl/version.go:61
}
func (v ClientVersion) String() string {
if v.Major == unknown || v.Minor == unknown {
return unknown
}
return v.Major + "." + v.Minor
}
// CheckVersion warns the user if their kubectl version is < 1.12.0
func (c *CLI) CheckVersion(ctx context.Context) error {
comp, err := c.CompareVersionTo(ctx, 1, 12)
if err != nil {
return err
}
if comp < 0 {
return errors.New("kubectl version 1.12.0 or greater is recommended for use with Skaffold")
}
return nil
}
func (c *CLI) CompareVersionTo(ctx context.Context, vMajor, vMinor int) (int, error) {
v := c.Version(ctx)
majorInt, err := strconv.Atoi(v.Major)
if err != nil {
return 0, fmt.Errorf("couldn't get kubectl minor version: %w", err)
}
// Some patched versions get a '+' suffix.
minorInt, err := strconv.Atoi(strings.TrimRight(v.Minor, "+"))
if err != nil {
return 0, fmt.Errorf("couldn't get kubectl minor version: %w", err)
}
View on GitHub (pinned to a1189de023)
Solutions
- Upgrade kubectl to >= 1.12 (`kubectl version --client` to check; install via krew, package manager, or GKE/cloud CLI)
- Ensure the newer kubectl is first on PATH (remove/renames stale binaries like /usr/local/bin/kubectl)
- Pin kubectl in CI images to a modern version matching the cluster
Example fix
// before $ kubectl version --client # v1.11.10 // after $ curl -LO https://dl.k8s.io/release/stable.txt/bin/linux/amd64/kubectl && install kubectl /usr/local/bin/ $ kubectl version --client # >= 1.12
Defensive patterns
Strategy: validation
Validate before calling
out, err := exec.Command("kubectl", "version", "--client", "-o", "json").Output()
var v struct{ ClientVersion struct{ Major, Minor string } }
json.Unmarshal(out, &v)
if parseMinor(v.ClientVersion.Minor) < 12 { return errors.New("kubectl >= 1.12 required") } Type guard
func kubectlAtLeast112(major, minor int) bool { return major > 1 || (major == 1 && minor >= 12) } Try / catch
if err := cli.CheckVersion(ctx); err != nil {
log.Warnf("kubectl check failed: %v — upgrade kubectl", err)
return fmt.Errorf("kubectl too old: %w", err)
} Prevention
- Pin kubectl version in CI images alongside cluster version
- Run `kubectl version --client` in environment bootstrap
- Keep kubectl first on PATH; remove stale binaries
When it happens
Trigger: Any code path calling kubectl.CLI.CheckVersion while the kubectl binary on PATH reports major.minor < 1.12 (e.g. 1.11.x or older).
Common situations: Old kubectl left in PATH from a legacy cluster install; CI images pinned to old kubectl; version skew after upgrading the cluster but not the local tooling.
Related errors
- instantiating default kubectl deployer: %w
- pre-sync hooks failed for artifact %q: %w
- post-sync hooks failed for artifact %q: %w
- copying files: %w
- `apply` requires at least one manifest argument
AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05).
Data as JSON: /api/errors/34531c690c06d6ad.
Report an issue: GitHub.