kubernetes/kops · error

instancegroup not found %q

Error message

instancegroup not found %q

What it means

filterInstanceGroupsByName is asked to return requested instance groups in a stable order via a name map; this error fires when one of the names in options.InstanceGroupNames has no matching InstanceGroup in the fetched list. It means the user requested an instance group that does not exist in the cluster.

Source

Thrown at cmd/kops/get_instancegroups.go:155

		return fullOutputJSON(out, singleObject, obj...)
	default:
		return fmt.Errorf("unknown output format: %q", options.Output)
	}
}

func filterInstanceGroupsByName(instanceGroupNames []string, list []api.InstanceGroup) ([]*api.InstanceGroup, error) {
	var instancegroups []*api.InstanceGroup
	if len(instanceGroupNames) != 0 {
		// Build a map so we can return items in the same order
		m := make(map[string]*api.InstanceGroup)
		for i := range list {
			ig := &list[i]
			m[ig.ObjectMeta.Name] = ig
		}
		for _, name := range instanceGroupNames {
			ig := m[name]
			if ig == nil {
				return nil, fmt.Errorf("instancegroup not found %q", name)
			}

			instancegroups = append(instancegroups, ig)
		}
	} else {
		for i := range list {
			ig := &list[i]
			instancegroups = append(instancegroups, ig)
		}
	}

	return instancegroups, nil
}

func igOutputTable(cluster *api.Cluster, instancegroups []*api.InstanceGroup, out io.Writer) error {
	t := &tables.Table{}
	t.AddColumn("NAME", func(c *api.InstanceGroup) string {
		return c.ObjectMeta.Name

View on GitHub (pinned to 4c8573c808)

Solutions

  1. List all instance groups (kops get ig) to see valid names
  2. Correct the typo in the requested instance group name
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at cmd/kops/get_instancegroups.go:155 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/da3bc92ccfef2d4b. Report an issue: GitHub.