{"record":{"id":"18d675515046d2ab","repo":"kubernetes/kops","slug":"cannot-specify-id-with-all","errorCode":null,"errorMessage":"cannot specify ID with \"all\"","messagePattern":"cannot specify ID with \"all\"","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kops/distrust_keypair.go","lineNumber":92,"sourceCode":"\tcmd := &cobra.Command{\n\t\tUse:     \"keypair {KEYSET [ID]... | all}\",\n\t\tShort:   distrustKeypairShort,\n\t\tLong:    distrustKeypairLong,\n\t\tExample: distrustKeypairExample,\n\t\tArgs: func(cmd *cobra.Command, args []string) error {\n\t\t\toptions.ClusterName = rootCommand.ClusterName(true)\n\t\t\tif options.ClusterName == \"\" {\n\t\t\t\treturn fmt.Errorf(\"--name is required\")\n\t\t\t}\n\n\t\t\tif len(args) == 0 {\n\t\t\t\treturn fmt.Errorf(\"must specify name of keyset to distrust keypair in\")\n\t\t\t}\n\t\t\toptions.Keyset = args[0]\n\n\t\t\tif len(args) > 1 {\n\t\t\t\tif options.Keyset == \"all\" {\n\t\t\t\t\treturn fmt.Errorf(\"cannot specify ID with \\\"all\\\"\")\n\t\t\t\t}\n\n\t\t\t\toptions.KeypairIDs = args[1:]\n\t\t\t}\n\n\t\t\treturn nil\n\t\t},\n\t\tValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {\n\t\t\treturn completeDistrustKeyset(cmd.Context(), f, options, args, toComplete)\n\t\t},\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\treturn RunDistrustKeypair(cmd.Context(), f, out, options)\n\t\t},\n\t}\n\n\treturn cmd\n}\n","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/cmd/kops/distrust_keypair.go#L74-L110","documentation":"The distrust keypair validator rejects combining the keyword 'all' with additional keypair ID arguments: 'all' distrusts every eligible keypair, so individual IDs are ambiguous/unnecessary in that form.","triggerScenarios":"Thrown at cmd/kops/distrust_keypair.go:92 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use 'kops distrust keypair all' without extra IDs","Or name a specific keyset followed by the IDs to distrust"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}