kubernetes/kops · error
--name is required
Error message
--name is required
What it means
The edit instancegroup command's argument validator found no cluster name: rootCommand.ClusterName(true) returned empty because neither --name nor a configured default cluster exists. The target cluster must be known before an IG can be edited.
Source
Thrown at cmd/kops/edit_instancegroup.go:89
Sets []string
// Unsets allows unsetting values directly in the spec.
Unsets []string
}
func NewCmdEditInstanceGroup(f *util.Factory, out io.Writer) *cobra.Command {
options := &EditInstanceGroupOptions{}
cmd := &cobra.Command{
Use: "instancegroup INSTANCE_GROUP",
Aliases: []string{"instancegroups", "ig"},
Short: editInstancegroupShort,
Long: editInstancegroupLong,
Example: editInstancegroupExample,
Args: func(cmd *cobra.Command, args []string) error {
options.ClusterName = rootCommand.ClusterName(true)
if options.ClusterName == "" {
return fmt.Errorf("--name is required")
}
if len(args) == 0 {
return fmt.Errorf("must specify the name of the instance group to edit")
}
options.GroupName = args[0]
if len(args) != 1 {
return fmt.Errorf("can only edit one instance group at a time")
}
return nil
},
ValidArgsFunction: completeInstanceGroup(f, nil, nil),
RunE: func(cmd *cobra.Command, args []string) error {
return RunEditInstanceGroup(cmd.Context(), f, out, options)
},View on GitHub (pinned to 4c8573c808)
Solutions
- Pass --name <clustername> to the command
- Configure a default cluster name for the kops CLI
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at cmd/kops/edit_instancegroup.go:89 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/26779c562dc5a93f.
Report an issue: GitHub.