kubernetes/kops · error

ResourceVersion not supported in InstanceGroupVFS::Get

Error message

ResourceVersion not supported in InstanceGroupVFS::Get

What it means

The VFS-backed InstanceGroup Get supports only default read semantics; requesting a specific ResourceVersion (stale/consistent read hint from the k8s API) cannot be honored by the underlying VFS store, so it is rejected up front rather than silently ignored.

Source

Thrown at cmd/kops-controller/pkg/controllerclientset/instancegroups.go:63

		klog.Fatalf("cluster / cluster.Name is required")
	}

	clusterName := cluster.Name
	kind := "InstanceGroup"

	r := &instanceGroups{
		// cluster:     cluster,
		clusterName: clusterName,
	}
	// We don't expect to need encoding
	var storeVersion runtime.GroupVersioner
	r.base.Init(kind, vfsContext, clusterBasePath.Join("instancegroup"), storeVersion)
	return r
}

func (c *instanceGroups) Get(ctx context.Context, name string, options metav1.GetOptions) (*kopsapi.InstanceGroup, error) {
	if options.ResourceVersion != "" {
		return nil, fmt.Errorf("ResourceVersion not supported in InstanceGroupVFS::Get")
	}

	o, err := c.base.Find(ctx, name)
	if err != nil {
		return nil, err
	}
	if o == nil {
		return nil, errors.NewNotFound(schema.GroupResource{Group: kopsapi.GroupName, Resource: "InstanceGroup"}, name)
	}
	ig := o.(*kopsapi.InstanceGroup)
	c.addLabels(ig)

	return ig, nil
}

func (c *instanceGroups) addLabels(ig *kopsapi.InstanceGroup) {
	if ig.ObjectMeta.Labels == nil {
		ig.ObjectMeta.Labels = make(map[string]string)

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Pass an empty metav1.GetOptions{} so no ResourceVersion is requested
  2. Strip ResourceVersion from GetOptions before calling VFS-backed Get
  3. If read consistency is required, use the real kubernetes API client instead of the VFS-backed one

Example fix

// before
ig, err := client.InstanceGroupsFor(cluster).Get(ctx, "nodes", metav1.GetOptions{ResourceVersion: rv})
// after
ig, err := client.InstanceGroupsFor(cluster).Get(ctx, "nodes", metav1.GetOptions{})
Defensive patterns

Strategy: validation

Validate before calling

if options.ResourceVersion != "" {
  options.ResourceVersion = "" // VFS-backed Get ignores consistency hints
}

Try / catch

ig, err := igs.Get(ctx, name, options)
if err != nil && strings.Contains(err.Error(), "ResourceVersion not supported") {
  ig, err = igs.Get(ctx, name, metav1.GetOptions{})
}

Prevention

When it happens

Trigger: Calling instanceGroups.Get(ctx, name, metav1.GetOptions{ResourceVersion: "12345"}) with a non-empty ResourceVersion, typically from code that copied options from a real kubernetes client call.

Common situations: Porting informer/watch-based code that threads ResourceVersion through Get; retry logic that reuses List options' ResourceVersion in Get.

Related errors


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/d01ae158350dad41. Report an issue: GitHub.