Skip to content

Commit

Permalink
NO-ISSUE: Bump operator to 0.0.4 (#1735)
Browse files Browse the repository at this point in the history
* NO-ISSUE: operator-bundle target to generate-bundle

Update hack/generate.sh to include steps for building the operator
manifests and replace `operator-bundle` target with `generate-bundle`.

* NO-ISSUE: Bump operator to 0.0.4

Update CSV base to use 0.0.4 and regen manifests.
  • Loading branch information
djzager authored May 17, 2021
1 parent 1709a50 commit 32486e6
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 23 deletions.
23 changes: 7 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ ifeq ($(ENABLE_KUBE_API),true)
STORAGE = filesystem
endif

# Operator Vars
BUNDLE_OUTPUT_DIR ?= deploy/olm-catalog
BUNDLE_METADATA_OPTS ?= --channels=alpha,ocm-2.3 --default-channel=alpha

# We decided to have an option to change replicas count only while running locally
# check if SERVICE_REPLICAS_COUNT was set and if yes change default value to required one
# Default for 1 replica
Expand Down Expand Up @@ -454,25 +458,12 @@ clean-onprem:
############
# Operator #
############

# Current Operator version
OPERATOR_VERSION ?= 0.0.3
BUNDLE_OUTPUT_DIR ?= deploy/olm-catalog
BUNDLE_METADATA_OPTS ?= --channels=alpha,ocm-2.3 --default-channel=alpha

.PHONY: operator-bundle
operator-bundle:
operator-sdk generate kustomize manifests --apis-dir internal/controller/api -q
# TODO(djzager) use this line to pin images in the future
# cd config/manager && kustomize edit set image controller=$(SERVICE)
kustomize build config/manifests | operator-sdk generate bundle -q --overwrite --version $(OPERATOR_VERSION) --output-dir $(BUNDLE_OUTPUT_DIR) $(BUNDLE_METADATA_OPTS)
# TODO(djzager) structure config/rbac in such a way to avoid need for this
rm $(BUNDLE_OUTPUT_DIR)/manifests/assisted-service_v1_serviceaccount.yaml
operator-sdk bundle validate $(BUNDLE_OUTPUT_DIR)
# TODO(djzager): remove when prow/ci-index is updated to use generate-bundle
operator-bundle: generate-bundle

# Build the bundle and index images.
.PHONY: operator-bundle-build operator-bundle-update
operator-bundle-build: operator-bundle
operator-bundle-build: generate-bundle
docker build $(CONTAINER_BUILD_PARAMS) -f deploy/olm-catalog/bundle.Dockerfile -t $(BUNDLE_IMAGE) .

operator-bundle-update:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ metadata:
annotations:
alm-examples: '[]'
capabilities: Basic Install
categories: OpenShift Optional
description: Assisted Service is used to orchestrate baremetal OpenShift installations.
olm.skipRange: <0.0.3
olm.skipRange: <0.0.4
operatorframework.io/suggested-namespace: assisted-installer
operators.operatorframework.io/builder: operator-sdk-v1.3.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
repository: https://github.com/openshift/assisted-service
support: https://github.com/openshift/assisted-service/issues/new
name: assisted-service-operator.v0.0.3
name: assisted-service-operator.v0.0.4
spec:
apiservicedefinitions: {}
customresourcedefinitions:
Expand Down Expand Up @@ -82,4 +83,4 @@ spec:
maturity: alpha
provider:
name: Red Hat
version: 0.0.3
version: 0.0.4
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,15 @@ metadata:
}
]
capabilities: Basic Install
categories: OpenShift Optional
description: Assisted Service is used to orchestrate baremetal OpenShift installations.
olm.skipRange: <0.0.3
olm.skipRange: <0.0.4
operatorframework.io/suggested-namespace: assisted-installer
operators.operatorframework.io/builder: operator-sdk-v1.6.1+git
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
repository: https://github.com/openshift/assisted-service
support: https://github.com/openshift/assisted-service/issues/new
name: assisted-service-operator.v0.0.3
name: assisted-service-operator.v0.0.4
spec:
apiservicedefinitions: {}
customresourcedefinitions:
Expand Down Expand Up @@ -564,4 +565,4 @@ spec:
maturity: alpha
provider:
name: Red Hat
version: 0.0.3
version: 0.0.4
2 changes: 1 addition & 1 deletion deploy/olm-catalog/metadata/annotations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ annotations:
operators.operatorframework.io.bundle.package.v1: assisted-service-operator
operators.operatorframework.io.bundle.channels.v1: alpha,ocm-2.3
operators.operatorframework.io.bundle.channel.default.v1: alpha
operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v3
operators.operatorframework.io.metrics.mediatype.v1: metrics+v1
operators.operatorframework.io.metrics.builder: operator-sdk-v1.6.1+git
operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v3

# Annotations for testing.
operators.operatorframework.io.test.mediatype.v1: scorecard+v1
Expand Down
11 changes: 11 additions & 0 deletions hack/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,17 @@ function generate_manifests() {
cp ${controller_crd_path}/resources.yaml ${BUILD_FOLDER}/resources.yaml
}

function generate_bundle() {
ENABLE_KUBE_API=true generate_manifests
operator-sdk generate kustomize manifests --apis-dir internal/controller/api -q
# TODO(djzager) use this line to pin images in the future
# cd config/manager && kustomize edit set image controller=${SERVICE}
kustomize build config/manifests | operator-sdk generate bundle -q --overwrite --output-dir ${BUNDLE_OUTPUT_DIR} ${BUNDLE_METADATA_OPTS}
# TODO(djzager) structure config/rbac in such a way to avoid need for this
rm ${BUNDLE_OUTPUT_DIR}/manifests/assisted-service_v1_serviceaccount.yaml
operator-sdk bundle validate ${BUNDLE_OUTPUT_DIR}
}

function generate_all() {
generate_from_swagger
generate_mocks
Expand Down

0 comments on commit 32486e6

Please sign in to comment.