{"record":{"id":"900af71264008a95","repo":"GoogleContainerTools/skaffold","slug":"getting-target-platforms-w","errorCode":null,"errorMessage":"getting target platforms: %w","messagePattern":"getting target platforms: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/runner/new.go","lineNumber":103,"sourceCode":"\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))\n\t\treturn nil, fmt.Errorf(\"creating verifier: %w\", err)\n\t}\n\n\tvar acsRunner ActionsRunner\n\tacsRunner, err = GetActionsRunner(ctx, runCtx, labeller, runCtx.VerifyDockerNetwork(), runCtx.Opts.VerifyEnvFile)\n\tif err != nil {\n\t\tendTrace(instrumentation.TraceEndError(err))\n\t\treturn nil, fmt.Errorf(\"creating actiosn runner: %w\", err)\n\t}\n\n\tdepLister := func(ctx context.Context, artifact *latest.Artifact, tag string) ([]string, error) {\n\t\tctx, endTrace := instrumentation.StartTrace(ctx, \"NewForConfig_depLister\")","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/runner/new.go#L85-L121","documentation":"When multi-platform builds are configured, `platform.NewResolver` computes the target platforms for all pipelines from the `platforms:` fields in skaffold.yaml and CLI `--platforms`. This wraps failures to resolve those platform strings into valid GOOS/GOARCH targets.","triggerScenarios":"Invalid or unknown platform strings in skaffold.yaml `platforms:` or `--platforms` flag (e.g. `linux/armv7` unsupported by the builder), conflicting platform selections across pipelines, or a platform specifier that fails to parse.","commonSituations":"Typo'd platform like `linux/amd64/x` after a config edit; requesting platforms the cluster/build backend can't support; mixing `--platforms` CLI with per-artifact platforms inconsistently.","solutions":["Fix platform strings to valid `os/arch[/variant]` triples (e.g. `linux/amd64`, `linux/arm64`, `linux/arm/v7`).","Remove conflicting platform selections so pipelines and `--platforms` agree.","Verify your builder supports the requested platforms (Docker buildx/Daemon multi-platform must be enabled).","Omit `platforms:` entirely if you only need the default host platform."],"exampleFix":"// skaffold.yaml before\nbuild:\n  platforms: [\"linux/armv99\"]\n// after\nbuild:\n  platforms: [\"linux/arm64\"]","handlingStrategy":"validation","validationCode":"var validPlatform = regexp.MustCompile(`^(linux|darwin|windows)/((amd64|arm64|arm|386)(/(v[5-8]))?)$`)\nfunc checkPlatforms(ps []string) error {\n  for _, p := range ps {\n    if !validPlatform.MatchString(p) {\n      return fmt.Errorf(\"invalid platform %q (want os/arch[/variant])\", p)\n    }\n  }\n  return nil\n}","typeGuard":null,"tryCatchPattern":"runner, err := runner.NewForConfig(runCtx)\nif err != nil {\n  if strings.Contains(err.Error(), \"getting target platforms\") {\n    return fmt.Errorf(\"platform config invalid: %w\", err)\n  }\n  return err\n}","preventionTips":["Use canonical platform strings: linux/amd64, linux/arm64, linux/arm/v7.","Keep CLI --platforms consistent with per-artifact platforms in skaffold.yaml.","Confirm builder multi-platform support (buildx) before adding arm64 targets.","Omit platforms entirely when default host platform is sufficient."],"tags":["platforms","multi-arch","config","build"],"backgroundTag":"invalid-platform-specifier","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"}