Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internalstorage: add Any CollectionResource #266

Merged
merged 1 commit into from
Jul 14, 2022

Conversation

Iceber
Copy link
Member

@Iceber Iceber commented Jul 14, 2022

issue: #258

$ kubectl  get collectionresources
NAME            RESOURCES
any             *
workloads       apps.deployments,apps.daemonsets,apps.statefulsets
kuberesources   .*,admission.k8s.io.*,admissionregistration.k8s.io.*,apiextensions.k8s.io.*,apps.*,authentication.k8s.io.*,authorization.k8s.io.*,autoscaling.*,batch.*,certificates.k8s.io.*,coordination.k8s.io.*,discovery.k8s.io.*,events.k8s.io.*,extensions.*,flowcontrol.apiserver.k8s.io.*,imagepolicy.k8s.io.*,internal.apiserver.k8s.io.*,networking.k8s.io.*,node.k8s.io.*,policy.*,rbac.authorization.k8s.io.*,scheduling.k8s.io.*,storage.k8s.io.*
$ kubectl get collectionresources any
Error from server (BadRequest): url query - `groups` or `resources` is required

$ kubectl get --raw /apis/clusterpedia.io/v1beta1/collectionresources/any?onlyMetadata=true&resources=apps/deployments,batch/jobs,batch/cronjobs

url query

  • groups Set the group to be retrieved,eg < group1 >,< group2 >/< version >
  • resources Set the resources to be retrieved, eg < group1 >/< resource >,< group2 >/< version >/< resource >

The groups and resources arguments are combined together to take a concatenation.
If groups=apps&resources=apps/deployments, then all resources under apps will be fetched.

This behavior may be modified in the future

You can use clusterpedia-io/client-go to fetch collection resource clusterpedia-io/client-go#43

@Iceber Iceber force-pushed the any-collection-resource branch 2 times, most recently from 6054efa to 35cb69f Compare July 14, 2022 04:52
@Iceber
Copy link
Member Author

Iceber commented Jul 14, 2022

Since any collection resource can view any type of resource, I'm not sure if I need to add a feature gate

@Iceber Iceber force-pushed the any-collection-resource branch from 35cb69f to 2397e7f Compare July 14, 2022 05:12
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
@Iceber Iceber force-pushed the any-collection-resource branch from 2397e7f to b457761 Compare July 14, 2022 05:16
@Iceber Iceber merged commit 649de78 into clusterpedia-io:main Jul 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant