{"record":{"id":"e61fc91da237bf5d","repo":"GoogleContainerTools/skaffold","slug":"creating-deployer-w","errorCode":null,"errorMessage":"creating deployer: %w","messagePattern":"creating deployer: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/runner/new.go","lineNumber":91,"sourceCode":"\t}\n\n\tvar deployer deploy.Deployer\n\n\thydrationDir, err := util.GetHydrationDir(runCtx.Opts, runCtx.WorkingDir, true, isKptRendererOrDeployerUsed(runCtx.Pipelines))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"getting render output path: %w\", err)\n\t}\n\n\trenderer, err := GetRenderer(ctx, runCtx, hydrationDir, labeller.Labels(), runCtx.UsingLegacyHelmDeploy())\n\tif err != nil {\n\t\tendTrace(instrumentation.TraceEndError(err))\n\t\treturn nil, fmt.Errorf(\"creating renderer: %w\", err)\n\t}\n\n\tdeployer, err = GetDeployer(ctx, runCtx, labeller, hydrationDir, runCtx.UsingLegacyHelmDeploy())\n\tif err != nil {\n\t\tendTrace(instrumentation.TraceEndError(err))\n\t\treturn nil, fmt.Errorf(\"creating deployer: %w\", err)\n\t}\n\trOpts := platform.ResolverOpts{\n\t\tKubeContext:               runCtx.KubeContext,\n\t\tCliPlatformsSelection:     runCtx.Opts.Platforms,\n\t\tCheckClusterNodePlatforms: runCtx.CheckClusterNodePlatforms(),\n\t\tDisableMultiPlatformBuild: runCtx.DisableMultiPlatformBuild(),\n\t}\n\n\tplatforms, err := platform.NewResolver(ctx, runCtx.Pipelines.All(), rOpts)\n\tif err != nil {\n\t\tendTrace(instrumentation.TraceEndError(err))\n\t\treturn nil, fmt.Errorf(\"getting target platforms: %w\", err)\n\t}\n\n\tvar verifier verify.Verifier\n\tverifier, err = GetVerifier(ctx, runCtx, labeller)\n\tif err != nil {\n\t\tendTrace(instrumentation.TraceEndError(err))","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/runner/new.go#L73-L109","documentation":"`GetDeployer` instantiates the deployer (kubectl, helm, kustomize, kpt, or cloud) from the skaffold.yaml deploy config. This wraps failures creating it — including missing/invalid kubeconfig context referenced at construction time.","triggerScenarios":"skaffold.yaml `deploy:` config that fails during construction: references a kube-context that doesn't exist, invalid kubectl/helm flags, malformed `kpt` deploy config, or the kubeconfig cannot be parsed when the deployer validates cluster access.","commonSituations":"Typo'd `kubeContext` name; CI environment without `~/.kube/config`; helm deployer with invalid `flags` or chart values; migrating from legacy `deploy.kustomize` to the renderer while deploy config remains inconsistent.","solutions":["Check the wrapped error; fix the corresponding `deploy:` block in skaffold.yaml.","Verify the kube-context exists: `kubectl config get-contexts`; create/update kubeconfig in CI via kubeconfig secret.","Validate helm/kubectl flags passed via `flags` are supported by the installed binary version.","Run `skaffold diagnose` for detailed config validation."],"exampleFix":"// skaffold.yaml before\ndeploy:\n  kubectl:\n    flags:\n      apply: [\"--unknown-flag\"]\n// after\ndeploy:\n  kubectl: {}","handlingStrategy":"validation","validationCode":"func kubeContextExists(name string) error {\n  out, err := exec.Command(\"kubectl\", \"config\", \"get-contexts\", \"-o\", \"name\").Output()\n  if err != nil { return err }\n  return fmt.Errorf(\"context %q found=%v\", name, strings.Contains(string(out), name))\n}","typeGuard":null,"tryCatchPattern":"runner, err := runner.NewForConfig(runCtx)\nif err != nil {\n  if strings.Contains(err.Error(), \"creating deployer\") {\n    return fmt.Errorf(\"deployer setup failed - check deploy config and kubeconfig: %w\", err)\n  }\n  return err\n}","preventionTips":["Verify `kubectl config get-contexts` includes the configured kubeContext before running.","Mount a valid kubeconfig secret in CI rather than relying on ~/.kube/config defaults.","Keep helm/kubectl flags minimal and version-compatible.","Run `skaffold diagnose` in CI to catch deploy config errors early."],"tags":["config","deploy","kubernetes","kubeconfig"],"backgroundTag":"deployer-init-failed","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"}