Skip to content

Commit

Permalink
[#885] Add ready printer column to ActiveMQArtemis CRD
Browse files Browse the repository at this point in the history
  • Loading branch information
brusdev committed Apr 22, 2024
1 parent 9c55c95 commit 426af6b
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ ifeq ($(ENABLE_WEBHOOKS),true)
## v2alpha3, v2alpha4 and v2alpha3 requires allowDangerousTypes=true because they use float32 type
cd config/manager && $(KUSTOMIZE) edit add resource webhook_secret.yaml
$(CONTROLLER_GEN) rbac:roleName=$(OPERATOR_CLUSTER_ROLE_NAME) crd:allowDangerousTypes=true webhook paths="./..." output:crd:artifacts:config=config/crd/bases
find config -type f -exec sed -i.bak -e '/creationTimestamp/d' {} \; -exec rm {}.bak \;
find config -type f -exec sed -i.bak -e '/creationTimestamp:/d' {} \; -exec rm {}.bak \;
else
## Generate ClusterRole and CustomResourceDefinition objects.
## v2alpha3, v2alpha4 and v2alpha3 requires allowDangerousTypes=true because they use float32 type
cd config/manager && $(KUSTOMIZE) edit remove resource webhook_secret.yaml
$(CONTROLLER_GEN) rbac:roleName=$(OPERATOR_CLUSTER_ROLE_NAME) crd:allowDangerousTypes=true paths="./..." output:crd:artifacts:config=config/crd/bases
find config -type f -exec sed -i.bak -e '/creationTimestamp/d' {} \; -exec rm {}.bak \;
find config -type f -exec sed -i.bak -e '/creationTimestamp:/d' {} \; -exec rm {}.bak \;
endif

.PHONY: generate
Expand Down Expand Up @@ -281,7 +281,7 @@ bundle: manifests operator-sdk kustomize ## Generate bundle manifests and metada
$(OPERATOR_SDK) generate kustomize manifests -q --package $(BUNDLE_PACKAGE)
cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG)
$(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle --package $(BUNDLE_PACKAGE) $(BUNDLE_GEN_FLAGS)
sed -i.bak '/creationTimestamp/d' ./bundle/manifests/*.yaml && rm ./bundle/manifests/*.bak
sed -i.bak '/creationTimestamp:/d' ./bundle/manifests/*.yaml && rm ./bundle/manifests/*.bak
sed -i.bak '/createdAt/d' ./bundle/manifests/*.yaml && rm ./bundle/manifests/*.bak
sed 's/annotations://' config/metadata/$(BUNDLE_PACKAGE).annotations.yaml >> bundle/metadata/annotations.yaml
sed -e 's/annotations://' -e 's/ /LABEL /g' -e 's/: /=/g' config/metadata/$(BUNDLE_PACKAGE).annotations.yaml >> bundle.Dockerfile
Expand Down
2 changes: 2 additions & 0 deletions api/v1beta1/activemqartemis_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,8 @@ type ExternalConfigStatus struct {
//+kubebuilder:storageversion
//+kubebuilder:resource:path=activemqartemises
//+kubebuilder:resource:path=activemqartemises,shortName=aa
//+kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status",description="The state of the resource"
//+kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="The age of the resource"
//+operator-sdk:csv:customresourcedefinitions:resources={{"Service", "v1"}}
//+operator-sdk:csv:customresourcedefinitions:resources={{"Secret", "v1"}}
//+operator-sdk:csv:customresourcedefinitions:resources={{"ConfigMap", "v1"}}
Expand Down
11 changes: 10 additions & 1 deletion bundle/manifests/broker.amq.io_activemqartemises.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,16 @@ spec:
singular: activemqartemis
scope: Namespaced
versions:
- name: v1beta1
- additionalPrinterColumns:
- description: The state of the resource
jsonPath: .status.conditions[?(@.type=='Ready')].status
name: Ready
type: string
- description: The age of the resource
jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta1
schema:
openAPIV3Schema:
description: A stateful deployment of one or more brokers
Expand Down
11 changes: 10 additions & 1 deletion config/crd/bases/broker.amq.io_activemqartemises.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,16 @@ spec:
singular: activemqartemis
scope: Namespaced
versions:
- name: v1beta1
- additionalPrinterColumns:
- description: The state of the resource
jsonPath: .status.conditions[?(@.type=='Ready')].status
name: Ready
type: string
- description: The age of the resource
jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta1
schema:
openAPIV3Schema:
description: A stateful deployment of one or more brokers
Expand Down
11 changes: 10 additions & 1 deletion deploy/activemq-artemis-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,16 @@ spec:
singular: activemqartemis
scope: Namespaced
versions:
- name: v1beta1
- additionalPrinterColumns:
- description: The state of the resource
jsonPath: .status.conditions[?(@.type=='Ready')].status
name: Ready
type: string
- description: The age of the resource
jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta1
schema:
openAPIV3Schema:
description: A stateful deployment of one or more brokers
Expand Down
11 changes: 10 additions & 1 deletion deploy/crds/broker_activemqartemis_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,16 @@ spec:
singular: activemqartemis
scope: Namespaced
versions:
- name: v1beta1
- additionalPrinterColumns:
- description: The state of the resource
jsonPath: .status.conditions[?(@.type=='Ready')].status
name: Ready
type: string
- description: The age of the resource
jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta1
schema:
openAPIV3Schema:
description: A stateful deployment of one or more brokers
Expand Down

0 comments on commit 426af6b

Please sign in to comment.