kubesphere/kubesphere · error

resource %s is not supported

Error message

resource %s is not supported

What it means

resourceQuotaGetter.getUsage guard: the requested quota resource key (e.g. a specific resource name in a ResourceQuota spec) is not present in the supportedResources map of listable resource types built at construction (with version adjustments for the cluster's K8s version). The unsupported resource name is included in the message.

Source

Thrown at pkg/models/quotas/quotas.go:73

		persistentvolumeclaimsKey: {Group: "", Version: "v1", Kind: "PersistentVolumeClaimList"},
		ingressKey:                {Group: "networking.k8s.io", Version: "v1", Kind: "IngressList"},
		jobsKey:                   {Group: "batch", Version: "v1", Kind: "JobList"},
		cronJobsKey:               {Group: "batch", Version: "v1", Kind: "CronJobList"},
	}
	if k8sutil.ServeBatchV1beta1(k8sVersion) {
		cronJobs := supportedResources[cronJobsKey]
		cronJobs.Version = "v1beta1"
		supportedResources[cronJobsKey] = cronJobs
	}

	return &resourceQuotaGetter{client: client, supportedResources: supportedResources}
}

func (c *resourceQuotaGetter) getUsage(namespace, resource string) (int, error) {
	var obj runtimeclient.ObjectList
	gvk, ok := c.supportedResources[resource]
	if !ok {
		return 0, fmt.Errorf("resource %s is not supported", resource)
	}

	if c.client.Scheme().Recognizes(gvk) {
		gvkObject, err := c.client.Scheme().New(gvk)
		if err != nil {
			return 0, nil
		}
		obj = gvkObject.(runtimeclient.ObjectList)
	} else {
		u := &unstructured.UnstructuredList{}
		u.SetGroupVersionKind(gvk)
		obj = u
	}

	if err := c.client.List(context.Background(), obj, runtimeclient.InNamespace(namespace)); err != nil {
		return 0, err
	}

View on GitHub (pinned to 04a29b5c60)

Solutions

  1. Remove the unsupported resource from the quota request or use one of the supported keys (pods, deployments, services, etc.)
  2. Extend the supportedResources map if the cluster genuinely provides that resource
  3. Check for typos/pluralization in the resource key
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at pkg/models/quotas/quotas.go:73 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of kubesphere/kubesphere@04a29b5c60 (2026-09-03). Data as JSON: /api/errors/d45c5507f66e0051. Report an issue: GitHub.