{"record":{"id":"ba6f79534f0d9598","repo":"kubernetes/kops","slug":"yaml-output-format-is-not-currently-supported-fo","errorCode":null,"errorMessage":"yaml output format is not (currently) supported for secrets","messagePattern":"yaml output format is not \\(currently\\) supported for secrets","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kops/get_secrets.go","lineNumber":145,"sourceCode":"\titems, err := listSecrets(secretStore, options.SecretNames)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif len(items) == 0 {\n\t\treturn fmt.Errorf(\"no secrets found\")\n\t}\n\tswitch options.Output {\n\n\tcase OutputTable:\n\t\tt := &tables.Table{}\n\t\tt.AddColumn(\"NAME\", func(i string) string {\n\t\t\treturn i\n\t\t})\n\t\treturn t.Render(items, out, \"NAME\")\n\n\tcase OutputYaml:\n\t\treturn fmt.Errorf(\"yaml output format is not (currently) supported for secrets\")\n\tcase OutputJSON:\n\t\treturn fmt.Errorf(\"json output format is not (currently) supported for secrets\")\n\tcase \"plaintext\":\n\t\tfor _, item := range items {\n\t\t\tvar data string\n\t\t\tsecret, err := secretStore.FindSecret(item)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"getting secret %q: %v\", item, err)\n\t\t\t}\n\t\t\tif secret == nil {\n\t\t\t\treturn fmt.Errorf(\"cannot find secret %q\", item)\n\t\t\t}\n\t\t\tdata = string(secret.Data)\n\n\t\t\t_, err = fmt.Fprintf(out, \"%s\\n\", data)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"writing output: %v\", err)\n\t\t\t}","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/cmd/kops/get_secrets.go#L127-L163","documentation":"The secrets command supports table, plaintext output (and legacy JSON errors similarly); YAML serialization of secrets was never implemented. Requesting `-o yaml` on `kops get secrets` returns this explicit not-supported error.","triggerScenarios":"Running `kops get secrets -o yaml` (or --output yaml).","commonSituations":"Users applying the standard kops `-o yaml` habit from other get commands; scripts that uniformly parse all get output as YAML.","solutions":["Use `-o plaintext` to dump secret values","Use the default table output for a name listing","If machine-readable output is needed, parse the plaintext output or use the kops API/clientset directly"],"exampleFix":"// before\nkops get secrets -o yaml\n\n// after\nkops get secrets -o plaintext","handlingStrategy":"validation","validationCode":"if [ \"$OUTPUT\" = \"yaml\" ]; then\n  echo \"yaml output not supported for secrets\"; OUTPUT=plaintext; fi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use plaintext or default table output for secrets","Do not assume -o yaml works uniformly across all kops get subcommands"],"tags":["cli","kops","unsupported-feature","output-format"],"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-12T12:17:11.808Z"}