summaryrefslogtreecommitdiffstats
path: root/src/monitor/pkg/apis/k8splugin
diff options
context:
space:
mode:
authorKiran Kamineni <kiran.k.kamineni@intel.com>2019-08-16 13:15:35 -0700
committerKiran Kamineni <kiran.k.kamineni@intel.com>2019-08-28 13:47:14 -0700
commit49249e28af27e96c58c9d792ba53f295c10e7e06 (patch)
tree8a193dd03861b6627d0884df70494dd61877e017 /src/monitor/pkg/apis/k8splugin
parentc5218d2a9d3d6ff009a87e7f1e999a8b5c0332d3 (diff)
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 <kiran.k.kamineni@intel.com>
Diffstat (limited to 'src/monitor/pkg/apis/k8splugin')
-rw-r--r--src/monitor/pkg/apis/k8splugin/v1alpha1/register.go13
-rw-r--r--src/monitor/pkg/apis/k8splugin/v1alpha1/types.go1
2 files changed, 14 insertions, 0 deletions
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"`