GoogleContainerTools/skaffold · error

unsupported template: %s

Error message

unsupported template: %s

What it means

Returned by doFindConfigs when the --format/-t flag value is not one of the supported template options in `skaffold find-configs`. The default branch of the format switch rejects any unrecognized value.

Source

Thrown at cmd/skaffold/app/cmd/find_configs.go:79

	case "json":
		encoder := json.NewEncoder(out)
		encoder.SetIndent("", "\t")
		return encoder.Encode(pathToVersion)

	case "table":
		pathOutLen, versionOutLen := 70, 30
		for p, v := range pathToVersion {
			c := output.Default
			if v != latest.Version {
				c = output.Green
			}
			c.Fprintf(out, fmt.Sprintf("%%-%ds\t%%-%ds\n", pathOutLen, versionOutLen), p, v)
		}

		return nil

	default:
		return fmt.Errorf("unsupported template: %s", format)
	}
}

func findConfigs(ctx context.Context, directory string) (map[string]string, error) {
	pathToVersion := make(map[string]string)

	// Find files ending in ".yaml" and parseable to skaffold config in the specified root directory recursively.
	isYaml := func(path string, info walk.Dirent) (bool, error) {
		return !info.IsDir() && (strings.HasSuffix(path, ".yaml") || strings.HasSuffix(path, ".yml")), nil
	}

	err := walk.From(directory).When(isYaml).Do(func(path string, _ walk.Dirent) error {
		if ctx.Err() != nil {
			return ctx.Err()
		}
		cfgs, err := schema.ParseConfig(path)
		switch {
		case err != nil:

View on GitHub (pinned to a1189de023)

Solutions

  1. Use one of the supported format values (check --help for find-configs)
  2. Correct the typo in the --format flag
  3. Drop the --format flag to use the default output
  4. Check the current skaffold version's docs, since formats can change between versions

Example fix

// before
skaffold find-configs --format jsonn
// error: unsupported template: jsonn
// after
skaffold find-configs --format json
Defensive patterns

Strategy: validation

Validate before calling

allowed := map[string]bool{"": true, "json": true /* see skaffold find-configs --help */}
if !allowed[format] {
    return fmt.Errorf("unsupported template: %s", format)
}

Prevention

When it happens

Trigger: `skaffold find-configs --format <value>` where value is not one of the handled template cases, hitting the `default:` branch at find_configs.go:79.

Common situations: Typo in the format name, copying a --format value from a different skaffold command, or scripting with an outdated format option after a version change.

Understand the failure class

Background: "unknown output mode", "invalid value for flag", "expects true/false": fixing invalid flag value errors in CLI tools — this error's family across 24 libraries.

Related errors


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