Skip to content

Commit

Permalink
Added version annotations in CRD (#270)
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishekdwivedi3060 authored Feb 12, 2024
1 parent c0c3aa5 commit 2dae26c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ help: ## Display this help.
.PHONY: manifests
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
cp $(ROOT_DIR)/config/crd/bases/asdb.aerospike.com_aerospikeclusters.yaml $(ROOT_DIR)/helm-charts/aerospike-kubernetes-operator/crds/customresourcedefinition_aerospikeclusters.asdb.aerospike.com.yaml

.PHONY: generate
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
Expand Down Expand Up @@ -156,14 +157,14 @@ run: manifests generate fmt vet ## Run a controller from your host.
docker-buildx: ## Build and push docker image for the manager for cross-platform support
- docker buildx create --name project-v3-builder
docker buildx use project-v3-builder
- docker buildx build --push --no-cache --platform=$(PLATFORMS) --tag ${IMG} --build-arg VERSION=$(VERSION) .
- docker buildx build --push --no-cache --provenance=false --platform=$(PLATFORMS) --tag ${IMG} --build-arg VERSION=$(VERSION) .
- docker buildx rm project-v3-builder

.PHONY: docker-buildx-openshift
docker-buildx-openshift: ## Build and push docker image for the manager for openshift cross-platform support
- docker buildx create --name project-v3-builder
docker buildx use project-v3-builder
- docker buildx build --push --no-cache --platform=$(PLATFORMS) --tag ${IMG} --tag ${IMG_TAGS} --build-arg VERSION=$(VERSION) --build-arg USER=1001 .
- docker buildx build --push --no-cache --provenance=false --platform=$(PLATFORMS) --tag ${IMG} --tag ${IMG_TAGS} --build-arg VERSION=$(VERSION) --build-arg USER=1001 .
- docker buildx rm project-v3-builder

.PHONY: docker-push
Expand Down
3 changes: 2 additions & 1 deletion api/v1/aerospikecluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ type AerospikePodStatus struct { //nolint:govet // for readability

// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
//+kubebuilder:storageversion
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:name="Size",type=string,JSONPath=`.spec.size`
// +kubebuilder:printcolumn:name="Image",type=string,JSONPath=`.spec.image`
// +kubebuilder:printcolumn:name="MultiPodPerHost",type=boolean,JSONPath=`.spec.podSpec.MultiPodPerHost`
Expand All @@ -840,6 +840,7 @@ type AerospikePodStatus struct { //nolint:govet // for readability

// AerospikeCluster is the schema for the AerospikeCluster API
// +operator-sdk:csv:customresourcedefinitions:displayName="Aerospike Cluster",resources={{Service, v1},{Pod,v1},{StatefulSet,v1}}
// +kubebuilder:metadata:annotations="aerospike-kubernetes-operator/version=3.2.1"
//
//nolint:lll // for readability
type AerospikeCluster struct { //nolint:govet // for readability
Expand Down
1 change: 1 addition & 0 deletions config/crd/bases/asdb.aerospike.com_aerospikeclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
aerospike-kubernetes-operator/version: 3.2.1
controller-gen.kubebuilder.io/version: v0.12.1
name: aerospikeclusters.asdb.aerospike.com
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
aerospike-kubernetes-operator/version: 3.2.1
controller-gen.kubebuilder.io/version: v0.12.1
name: aerospikeclusters.asdb.aerospike.com
spec:
Expand Down

0 comments on commit 2dae26c

Please sign in to comment.