Skip to content

Commit

Permalink
chore: small updates
Browse files Browse the repository at this point in the history
* PROJECT
 * version increment of hawtio CRD

* CSV files
 * Re-creates bundle and updates the versions

* Makefile
 * Adds publish-image rule
 * build rule should re-generate CRD not just go files
 * deploy-crd should publish the CRD as kustomize sees it not just the base
  • Loading branch information
phantomjinx committed Apr 4, 2024
1 parent 06de0f9 commit a54c298
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 16 deletions.
31 changes: 27 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ ifeq ($(DEBUG),true)
GOFLAGS += -gcflags="all=-N -l"
endif

.PHONY: image build compile go-generate test manifests k8s-generate install deploy bundle controller-gen kubectl kustomize check-admin setup operator app
.PHONY: image publish-image build compile go-generate test manifests k8s-generate install deploy bundle controller-gen kubectl kustomize check-admin setup operator app

#
# Function for editing kustomize parameters
Expand Down Expand Up @@ -88,6 +88,22 @@ image:
--build-arg HAWTIO_ONLINE_VERSION=$(HAWTIO_ONLINE_VERSION) \
.

#---
#
#@ publish-image
#
#== Compile the operator as a docker image then push the image to the repository
#
#* PARAMETERS:
#** IMAGE: Set a custom image for the container image
#** VERSION: Set a custom version for the container image tag
#** HAWTIO_ONLINE_IMAGE_NAME Set the operator's target hawtio-online image name
#** HAWTIO_ONLINE_VERSION Set the operator's target hawtio-online image version
#
#---
publish-image: image
docker push $(IMAGE):$(VERSION)

#---
#
#@ build
Expand All @@ -97,7 +113,7 @@ image:
#** GOLDFLAGS: Add any go-lang ldflags, eg. -X main.ImageVersion=2.0.0-202312061128 will compile in the operand version
#
#---
build: go-generate compile test
build: generate compile test

compile:
CGO_ENABLED=0 go build $(GOFLAGS) -o hawtio-operator ./cmd/manager/main.go
Expand Down Expand Up @@ -140,9 +156,16 @@ get-version:
#
#=== Can only be executed as a cluster-admin
#
#* PARAMETERS:
#** DEBUG: Print the resources to be applied instead of applying them [ true | false ]
#
#---
deploy-crd: kubectl
kubectl apply -f $(INSTALL_ROOT)/crd/hawt.io_hawtios.yaml
ifeq ($(DEBUG), false)
$(KUSTOMIZE) build $(KOPTIONS) $(INSTALL_ROOT)/crd | kubectl apply -f -
else
$(KUSTOMIZE) build $(KOPTIONS) $(INSTALL_ROOT)/crd
endif

#---
#
Expand Down Expand Up @@ -270,7 +293,7 @@ bundle-build: bundle
#== Builds a test catalog index for installing the operator via an OLM
#
#* PARAMETERS:
#** IMAGE: Set the custom image name (suffixed with '-bundle')
#** IMAGE: Set the custom image name (will be suffixed with '-bundle')
#** VERSION: Set the custom version for the bundle image
#
#---
Expand Down
3 changes: 1 addition & 2 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ resources:
domain: hawt.io
group: hawt.io
kind: Hawtio
# TODO(user): Update the package path for your API if the below value is incorrect.
path: github.com/hawtio/hawtio-operator/pkg/apis/v1alpha1
path: github.com/hawtio/hawtio-operator/pkg/apis/v1
version: v1alpha1
version: "3"
plugins:
Expand Down
8 changes: 4 additions & 4 deletions bundle/bases/hawtio-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ metadata:
categories: Integration & Delivery
certified: "false"
description: Hawtio eases the discovery and management of Java applications deployed on OpenShift.
containerImage: quay.io/hawtio/operator:1.0.1
containerImage: quay.io/hawtio/operator:1.0.2
repository: https://github.com/hawtio/hawtio-operator
support: Red Hat
name: hawtio-operator.v1.0.1
name: hawtio-operator.v1.0.2
spec:
displayName: Hawtio Operator
maintainers:
- email: [email protected]
name: The Hawtio team
provider:
name: Red Hat
version: 1.0.1
replaces: hawtio-operator.v0.5.0
version: 1.0.2
replaces: hawtio-operator.v1.0.1
maturity: alpha
minKubeVersion: 1.11.0
description: |
Expand Down
12 changes: 6 additions & 6 deletions bundle/manifests/hawtio-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ metadata:
capabilities: Seamless Upgrades
categories: Integration & Delivery
certified: "false"
containerImage: quay.io/hawtio/operator:1.0.1
createdAt: "2024-02-06T20:04:49Z"
containerImage: quay.io/hawtio/operator:1.0.2
createdAt: "2024-04-04T14:20:31Z"
description: Hawtio eases the discovery and management of Java applications deployed
on OpenShift.
operators.operatorframework.io/builder: operator-sdk-v1.28.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v2
repository: https://github.com/hawtio/hawtio-operator
support: Red Hat
name: hawtio-operator.v1.0.1
name: hawtio-operator.v1.0.2
spec:
apiservicedefinitions: {}
customresourcedefinitions:
Expand Down Expand Up @@ -167,7 +167,7 @@ spec:
fieldPath: metadata.name
- name: OPERATOR_NAME
value: hawtio-operator
image: quay.io/hawtio/operator:1.0.1
image: quay.io/hawtio/operator:1.0.2
imagePullPolicy: Always
name: hawtio-operator
ports:
Expand Down Expand Up @@ -296,5 +296,5 @@ spec:
minKubeVersion: 1.11.0
provider:
name: Red Hat
replaces: hawtio-operator.v0.5.0
version: 1.0.1
replaces: hawtio-operator.v1.0.1
version: 1.0.2
6 changes: 6 additions & 0 deletions script/build_bundle_index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ fi
mkdir -p "${INDEX_DIR}"

if [ ! -f ${INDEX_BASE_YAML} ]; then
# Pull the latest version of the catalog index image
docker pull ${BUNDLE_INDEX}
if [ $? != 0 ]; then
echo "Error: failed to pull latest version of bundle catalog index image"
exit 1
fi
${OPM} render ${BUNDLE_INDEX} -o yaml > ${INDEX_BASE_YAML}
if [ $? != 0 ]; then
echo "Error: failed to render the base catalog"
Expand Down

0 comments on commit a54c298

Please sign in to comment.