From cc1d9459fca5984e46c2ae95efe30f70362037dc Mon Sep 17 00:00:00 2001 From: Maciej Zimnoch Date: Thu, 30 Jul 2020 09:25:06 +0200 Subject: [PATCH 1/2] Makefile: make manifests generates examples --- Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 133d66231dd..765a7655f2a 100644 --- a/Makefile +++ b/Makefile @@ -47,13 +47,12 @@ cert-manager: deploy: manifests cert-manager cd config/manager && kustomize edit set image controller=${IMG} kustomize build config/default | kubectl apply -f - - kustomize build config/default > examples/generic/operator.yaml - kustomize build config/default > examples/gke/operator.yaml # Generate manifests e.g. CRD, RBAC etc. manifests: bin/deps controller-gen $(CONTROLLER_GEN) $(CRD_OPTIONS) webhook rbac:roleName=manager-role paths="$(PKG)" output:crd:artifacts:config=config/crd/bases output:rbac:artifacts:config=config/rbac/bases - + kustomize build config/default > examples/generic/operator.yaml + kustomize build config/default > examples/gke/operator.yaml # Run go fmt against code fmt: go fmt $(PKG) From 4f76772f243bde8ebf3a7aa1bc18b5cf00e7ff5e Mon Sep 17 00:00:00 2001 From: Maciej Zimnoch Date: Thu, 30 Jul 2020 09:32:04 +0200 Subject: [PATCH 2/2] api: fix update of cluster status (#164) Fixes #164 --- config/crd/bases/scylla.scylladb.com_clusters.yaml | 2 ++ examples/generic/operator.yaml | 2 ++ examples/gke/operator.yaml | 2 ++ pkg/api/v1alpha1/cluster_types.go | 1 + 4 files changed, 7 insertions(+) diff --git a/config/crd/bases/scylla.scylladb.com_clusters.yaml b/config/crd/bases/scylla.scylladb.com_clusters.yaml index e6767b66c97..dd4dda864db 100644 --- a/config/crd/bases/scylla.scylladb.com_clusters.yaml +++ b/config/crd/bases/scylla.scylladb.com_clusters.yaml @@ -15,6 +15,8 @@ spec: plural: clusters singular: cluster scope: Namespaced + subresources: + status: {} validation: openAPIV3Schema: description: Cluster is the Schema for the clusters API diff --git a/examples/generic/operator.yaml b/examples/generic/operator.yaml index 362459cc2e6..827c5fcf0b5 100644 --- a/examples/generic/operator.yaml +++ b/examples/generic/operator.yaml @@ -30,6 +30,8 @@ spec: singular: cluster preserveUnknownFields: false scope: Namespaced + subresources: + status: {} validation: openAPIV3Schema: description: Cluster is the Schema for the clusters API diff --git a/examples/gke/operator.yaml b/examples/gke/operator.yaml index 362459cc2e6..827c5fcf0b5 100644 --- a/examples/gke/operator.yaml +++ b/examples/gke/operator.yaml @@ -30,6 +30,8 @@ spec: singular: cluster preserveUnknownFields: false scope: Namespaced + subresources: + status: {} validation: openAPIV3Schema: description: Cluster is the Schema for the clusters API diff --git a/pkg/api/v1alpha1/cluster_types.go b/pkg/api/v1alpha1/cluster_types.go index c03acd0e7c0..79e577ce19e 100644 --- a/pkg/api/v1alpha1/cluster_types.go +++ b/pkg/api/v1alpha1/cluster_types.go @@ -159,6 +159,7 @@ const ( ) // +kubebuilder:object:root=true +// +kubebuilder:subresource:status // Cluster is the Schema for the clusters API type Cluster struct {