From 49249e28af27e96c58c9d792ba53f295c10e7e06 Mon Sep 17 00:00:00 2001 From: Kiran Kamineni Date: Fri, 16 Aug 2019 13:15:35 -0700 Subject: Adding typed client for CRD Adding a typed client for CRD Generated using the generate-groups.sh script from the kubernetes/code-generator repo Issue-ID: MULTICLOUD-675 Change-Id: I6c712980595dfed7a8b9c51f50edfc6788372dfd Signed-off-by: Kiran Kamineni --- src/monitor/pkg/apis/k8splugin/v1alpha1/register.go | 13 +++++++++++++ src/monitor/pkg/apis/k8splugin/v1alpha1/types.go | 1 + 2 files changed, 14 insertions(+) (limited to 'src/monitor/pkg/apis/k8splugin') diff --git a/src/monitor/pkg/apis/k8splugin/v1alpha1/register.go b/src/monitor/pkg/apis/k8splugin/v1alpha1/register.go index ee2af820..7d3334a9 100644 --- a/src/monitor/pkg/apis/k8splugin/v1alpha1/register.go +++ b/src/monitor/pkg/apis/k8splugin/v1alpha1/register.go @@ -16,4 +16,17 @@ var ( // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion} + + // AddToScheme is a global function variable that registers this API + AddToScheme = SchemeBuilder.AddToScheme ) + +// Kind takes an unqualified kind and returns back a Group qualified GroupKind +func Kind(kind string) schema.GroupKind { + return SchemeGroupVersion.WithKind(kind).GroupKind() +} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} diff --git a/src/monitor/pkg/apis/k8splugin/v1alpha1/types.go b/src/monitor/pkg/apis/k8splugin/v1alpha1/types.go index 22dfdd25..30fe1dd2 100644 --- a/src/monitor/pkg/apis/k8splugin/v1alpha1/types.go +++ b/src/monitor/pkg/apis/k8splugin/v1alpha1/types.go @@ -10,6 +10,7 @@ import ( // ResourceBundleState is the Schema for the ResourceBundleStatees API // +k8s:openapi-gen=true // +kubebuilder:subresource:status +// +genclient type ResourceBundleState struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` -- cgit 1.2.3-korg