{"record":{"id":"5f31abf94d65f4fd","repo":"kubernetes/kops","slug":"unsupported-output-type-q-5f31ab","errorCode":null,"errorMessage":"unsupported output type %q","messagePattern":"unsupported output type %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kops/toolbox_instance-selector.go","lineNumber":338,"sourceCode":"\t\tif igCount != 1 {\n\t\t\tdoubledRatio := (*mutatedFilters.VCpusToMemoryRatio) * 2\n\t\t\tmutatedFilters.VCpusToMemoryRatio = &doubledRatio\n\t\t}\n\t}\n\n\tif options.DryRun {\n\t\tfor _, ig := range newInstanceGroups {\n\t\t\tswitch options.Output {\n\t\t\tcase OutputYaml:\n\t\t\t\tif err := fullOutputYAML(out, ig); err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"error writing cluster yaml to stdout: %v\", err)\n\t\t\t\t}\n\t\t\tcase OutputJSON:\n\t\t\t\tif err := fullOutputJSON(out, true, ig); err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"error writing cluster json to stdout: %v\", err)\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\treturn fmt.Errorf(\"unsupported output type %q\", options.Output)\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}\n\n\tfor _, ig := range newInstanceGroups {\n\t\t_, err = clientset.InstanceGroupsFor(cluster).Create(ctx, ig, metav1.CreateOptions{})\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error storing InstanceGroup: %v\", err)\n\t\t}\n\n\t\tif err := fullOutputYAML(out, ig); err != nil {\n\t\t\treturn fmt.Errorf(\"error writing cluster yaml to stdout: %v\", err)\n\t\t}\n\t}\n\n\treturn nil\n}","sourceCodeStart":320,"sourceCodeEnd":356,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/cmd/kops/toolbox_instance-selector.go#L320-L356","documentation":"In --dry-run mode, options.Output matched neither the YAML nor JSON constants, so kOps refuses to emit the InstanceGroups rather than guessing a format. This is a strict validation of the --output flag value.","triggerScenarios":"Running `kops toolbox instance-selector --dry-run` with --output set to something other than yaml/json (e.g. 'yml', 'text', or a misspelling) — the switch in the dry-run branch falls through to default.","commonSituations":"Typo like --output YML (case-sensitive constants) or abbreviations; scripts copied from `kops get` examples using formats supported elsewhere but not here.","solutions":["Pass --output yaml or --output json exactly (lowercase).","Omit conflicting formats when scripting; validate the flag in wrapper scripts.","Check `kops toolbox instance-selector --help` for accepted values."],"exampleFix":"// before\nkops toolbox instance-selector --dry-run --output yml\n// after\nkops toolbox instance-selector --dry-run --output yaml","handlingStrategy":"validation","validationCode":"func validOutput(o string) bool { return o == \"yaml\" || o == \"json\" }\n// usage: if !validOutput(*outputFlag) { flag.Usage(); os.Exit(2) }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use lowercase yaml/json exactly — values are case-sensitive.","Shell-complete or whitelist the flag in wrapper scripts.","Consult `kops toolbox instance-selector --help` for accepted values."],"tags":["cli-flags","validation","dry-run"],"backgroundTag":"invalid-flag-value","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}