{"record":{"id":"2fe8f5c69ce25a3d","repo":"kubernetes/kops","slug":"unsupported-output-type-q-2fe8f5","errorCode":null,"errorMessage":"unsupported output type %q","messagePattern":"unsupported output type %q","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kops/create_instancegroup.go","lineNumber":252,"sourceCode":"\t\t}\n\n\t\t// Cluster name is not populated, and we need it\n\t\tig.ObjectMeta.Labels = make(map[string]string)\n\t\tig.ObjectMeta.Labels[kopsapi.LabelClusterName] = cluster.ObjectMeta.Name\n\n\t\tswitch options.Output {\n\t\tcase OutputYaml:\n\t\t\tif err := fullOutputYAML(out, ig); err != nil {\n\t\t\t\treturn fmt.Errorf(\"error writing cluster yaml to stdout: %v\", err)\n\t\t\t}\n\t\t\treturn nil\n\t\tcase OutputJSON:\n\t\t\tif err := fullOutputJSON(out, true, ig); err != nil {\n\t\t\t\treturn fmt.Errorf(\"error writing cluster json to stdout: %v\", err)\n\t\t\t}\n\t\t\treturn nil\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"unsupported output type %q\", options.Output)\n\t\t}\n\t}\n\n\tif options.Edit {\n\t\tedit := editor.NewDefaultEditor(commandutils.EditorEnvs)\n\n\t\traw, err := kopscodecs.ToVersionedYaml(ig)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\text := \"yaml\"\n\n\t\t// launch the editor\n\t\tedited, file, err := edit.LaunchTempFile(fmt.Sprintf(\"%s-edit-\", filepath.Base(os.Args[0])), ext, bytes.NewReader(raw))\n\t\tdefer func() {\n\t\t\tif file != \"\" {\n\t\t\t\ttry.RemoveFile(file)\n\t\t\t}","sourceCodeStart":234,"sourceCodeEnd":270,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/cmd/kops/create_instancegroup.go#L234-L270","documentation":"After creating the InstanceGroup, RunCreateInstanceGroup switches on options.Output to decide how to print the result. Only yaml and json are supported; any other value reaches the default branch and returns this error. It is a guard against invalid user-supplied output format flags.","triggerScenarios":"Invoking `kops create instancegroup --output <format>` (or -o) with any value other than \"yaml\" or \"json\", e.g. `--output table`, `--output yamlv2`, or a typo like `--output ymal`.","commonSituations":"Copy-pasted commands from other k8s CLIs that accept other formats; scripting with a variable that is empty or misspelled; assuming output formats supported by other kops subcommands apply here.","solutions":["Use `-o yaml` or `-o json` explicitly","Check the command help (`kops create instancegroup --help`) for supported output values","Fix typos in the --output flag value (e.g. 'ymal' -> 'yaml')","Ensure any script variable feeding --output is set and equals 'yaml' or 'json'"],"exampleFix":"// before\nkops create instancegroup --name nodes --output table\n// after\nkops create instancegroup --name nodes --output yaml","handlingStrategy":"validation","validationCode":"if [ \"$OUTPUT\" != \"yaml\" ] && [ \"$OUTPUT\" != \"json\" ]; then echo \"-o must be yaml|json\" >&2; exit 2; fi","typeGuard":"func validOutput(s string) bool { switch s { case \"yaml\", \"json\": return true }; return false }","tryCatchPattern":null,"preventionTips":["Consult `kops create instancegroup --help` for allowed -o values","Centralize output-format constants in scripts (OUTPUT=yaml)","Never copy --output values from tools that support other formats"],"tags":["cli","flags","validation"],"backgroundTag":"unsupported-output-format","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}