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

add collection resource client #43

Merged

Conversation

calvin0327
Copy link
Contributor

Signed-off-by: calvin wen.chen@daocloud.io

fixed: #37

/kind feature

add client to satisfy clusterpedia collectionresource feature.

Signed-off-by: calvin <wen.chen@daocloud.io>
@calvin0327
Copy link
Contributor Author

@Iceber @ClerverHu /cc

@cleverhu
Copy link

cleverhu commented Jul 1, 2022

/lgtm

@Iceber
Copy link
Member

Iceber commented Jul 14, 2022

It looks like the custom resource client and collection can be combined into ClusterPediaV1alpha1Client
eg.

type ClusterPediaV1beta1 interface {
        ListCollectionResources() (*clusterpediav1beta1.CollectionResourceList, error)
        CollectionResource(name string) CollectionResourceInterface

        Resource(resource schema.GroupVersionResource) NamespaceableResourceInterface
}

type CollectionResourceInterface interface {
        Fetch(ctx context.Context, opts metav1.ListOptions, params map[string]string) (*clusterpediav1beta1.CollectionResource, error)
}

type ResourceInterface interface {
        List(ctx context.Context, opts metav1.ListOptions, params map[string]string, obj runtime.Object) error
}

type NamespaceableResourceInterface interface {
        Namespace(string) ResourceInterface
        ResourceInterface
}

What do you think?

@calvin0327 calvin0327 merged commit d877935 into clusterpedia-io:main Jul 21, 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.

We should provide a client for collecting resources
3 participants