kubernetes/kops · error

InstanceGroupVFS DeleteCollection not implemented for vfs st

Error message

InstanceGroupVFS DeleteCollection not implemented for vfs store

What it means

InstanceGroupVFS does not implement bulk deletion for the VFS-backed state store; DeleteCollection always returns this error. The capability simply is not available for vfs-based clientsets (Watch is likewise unimplemented).

Source

Thrown at pkg/client/simple/vfsclientset/instancegroup.go:134

	if !apiequality.Semantic.DeepEqual(old.Spec, g.Spec) {
		g.SetGeneration(old.GetGeneration() + 1)
	}

	validation.ValidateInstanceGroup(g, nil, true)
	err = c.update(ctx, c.cluster, g)
	if err != nil {
		return nil, err
	}
	return g, nil
}

func (c *InstanceGroupVFS) Delete(ctx context.Context, name string, options metav1.DeleteOptions) error {
	return c.delete(ctx, name, options)
}

func (r *InstanceGroupVFS) DeleteCollection(ctx context.Context, options metav1.DeleteOptions, listOptions metav1.ListOptions) error {
	return fmt.Errorf("InstanceGroupVFS DeleteCollection not implemented for vfs store")
}

func (r *InstanceGroupVFS) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
	return nil, fmt.Errorf("InstanceGroupVFS Watch not implemented for vfs store")
}

func (r *InstanceGroupVFS) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *kopsapi.InstanceGroup, err error) {
	return nil, fmt.Errorf("InstanceGroupVFS Patch not implemented for vfs store")
}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Enumerate instance groups with List and call Delete per item instead.
  2. Restructure the code path to avoid DeleteCollection when using the VFS clientset.
  3. If the feature is needed, implement DeleteCollection in InstanceGroupVFS by iterating names and deleting each.

Example fix

// before
c.DeleteCollection(ctx, metav1.DeleteOptions{}, metav1.ListOptions{})
// after
list, _ := c.List(ctx, metav1.ListOptions{})
for _, ig := range list.Items {
    _ = c.Delete(ctx, ig.Name, metav1.DeleteOptions{})
}
Defensive patterns

Strategy: fallback

Validate before calling

if needsBulkDelete {
    return fmt.Errorf("use per-item Delete with the VFS clientset; DeleteCollection is unsupported")
}

Try / catch

if err := client.DeleteCollection(ctx, opts, listOpts); err != nil {
    if strings.Contains(err.Error(), "not implemented") {
        return deleteAllIndividually(ctx, client) // fallback path
    }
    return err
}

Prevention

When it happens

Trigger: Any call to InstanceGroupVFS.DeleteCollection, e.g. generic cleanup code that deletes all instance groups matching a list/label selector against a VFS-backed client.

Common situations: Code shared between the API-server clientset and the VFS clientset hitting the unimplemented method; tooling assuming full k8s client semantics against the kops state store.

Related errors


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