{"record":{"id":"51ebb5b2583d18c7","repo":"kubernetes/kops","slug":"name-is-required-51ebb5","errorCode":null,"errorMessage":"--name is required","messagePattern":"--name is required","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kops/create_instancegroup.go","lineNumber":100,"sourceCode":"\n// NewCmdCreateInstanceGroup create a new cobra command object for creating a instancegroup.\nfunc NewCmdCreateInstanceGroup(f *util.Factory, out io.Writer) *cobra.Command {\n\toptions := &CreateInstanceGroupOptions{\n\t\tRole: kopsapi.InstanceGroupRoleNode.ToLowerString(),\n\t\tEdit: true,\n\t}\n\n\tcmd := &cobra.Command{\n\t\tUse:     \"instancegroup INSTANCE_GROUP\",\n\t\tAliases: []string{\"instancegroups\", \"ig\"},\n\t\tShort:   createInstanceGroupShort,\n\t\tLong:    createInstanceGroupLong,\n\t\tExample: createInstanceGroupExample,\n\t\tArgs: func(cmd *cobra.Command, args []string) error {\n\t\t\toptions.ClusterName = rootCommand.ClusterName(true)\n\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 instance group to create\")\n\t\t\t}\n\n\t\t\toptions.InstanceGroupName = args[0]\n\n\t\t\tif len(args) != 1 {\n\t\t\t\treturn fmt.Errorf(\"can only create one instance group at a time\")\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\tcommandutils.ConfigureKlogForCompletion()\n\t\t\tif len(args) == 1 && rootCommand.ClusterName(false) == \"\" {\n\t\t\t\treturn []string{\"--name\"}, cobra.ShellCompDirectiveNoFileComp","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/cmd/kops/create_instancegroup.go#L82-L118","documentation":"The create instancegroup command's argument validator found no cluster name: rootCommand.ClusterName(true) returned empty because neither a positional/flag cluster name nor a configured default exists. The command cannot proceed without knowing which cluster to add the IG to.","triggerScenarios":"Thrown at cmd/kops/create_instancegroup.go:100 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass the cluster name via --name or the parent command configuration","Set the cluster name in the kops configuration used by the CLI"],"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"}