Skip to content

Commit

Permalink
set up for iterative catalog version
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyary committed Oct 8, 2021
1 parent acc0f83 commit e2bd90f
Show file tree
Hide file tree
Showing 8 changed files with 145 additions and 11 deletions.
39 changes: 35 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,27 @@
# To re-generate a bundle for another specific version without changing the standard setup, you can:
# - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2)
# - use environment variables to overwrite this value (e.g export VERSION=0.0.2)
VERSION ?= 0.1.1
VERSION ?= 0.1.2

# OLD_BUNDLE_VERSIONS defines the comma separated list of versions of old bundles to add to the index.
#
# This is NOT required if you are incrementally building the catalog index. If you need to increment on
# a catalog that already HAS old bundles, such as when building/pushing the official release, then you do NOT
# need to uncomment & add the old bundles - the existing "from-index" catalog already has those.
#
# If you are developing and pushing against your OWN quay for testing, you likely need to uncomment
#OLD_BUNDLE_VERSIONS ?= 0.1.0,0.1.1

# CATALOG_VERSION defines the version of the index image.
CATALOG_VERSION ?= 0.1

# QUAY_ORG indicates the organization that docker images will be build for & pushed to
# CHANGE THIS TO YOUR OWN QUAY USERNAME FOR DEV/TESTING/PUSHING
QUAY_ORG ?= ecosystem-appeng

# CATALOG_BASE_IMG defines an existing catalog version to build on & add bundles to
CATALOG_BASE_IMG ?= quay.io/$(QUAY_ORG)/dbaas-operator-catalog:v$(CATALOG_VERSION)

export OPERATOR_CONDITION_NAME=dbaas-operator.v$(VERSION)

# CHANNELS define the bundle channels used in the bundle.
Expand All @@ -30,12 +50,19 @@ BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)
#
# For example, running 'make bundle-build bundle-push catalog-build catalog-push' will build and push both
# redhat.com/dbaas-operator-bundle:$VERSION and redhat.com/dbaas-operator-catalog:$VERSION.
IMAGE_TAG_BASE ?= quay.io/ecosystem-appeng/dbaas-operator
IMAGE_TAG_BASE ?= quay.io/$(QUAY_ORG)/dbaas-operator

# BUNDLE_IMG defines the image:tag used for the bundle.
# You can use it as an arg. (E.g make bundle-build BUNDLE_IMG=<some-registry>/<project-name-bundle>:<tag>)
BUNDLE_IMG ?= $(IMAGE_TAG_BASE)-bundle:v$(VERSION)

# OLD_BUNDLE_IMGS defines the comma separated list of old bundles to add to the index.
COMMA := ,
EMPTY :=
SPACE := $(EMPTY) $(EMPTY)
OLD_BUNDLE_IMG_TAG_BASE ?= $(IMAGE_TAG_BASE)-bundle
OLD_BUNDLE_IMGS ?= $(patsubst %$(COMMA),%$(EMPTY),$(subst $(SPACE),$(EMPTY),$(foreach ver,$(subst $(COMMA),$(SPACE),$(OLD_BUNDLE_VERSIONS)),$(OLD_BUNDLE_IMG_TAG_BASE):v$(ver),)))

# Image URL to use all building/pushing image targets
IMG ?= $(IMAGE_TAG_BASE):v$(VERSION)
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
Expand Down Expand Up @@ -94,7 +121,7 @@ test: manifests generate fmt vet ## Run tests.
source ${ENVTEST_ASSETS_DIR}/setup-envtest.sh; fetch_envtest_tools $(ENVTEST_ASSETS_DIR); setup_envtest_env $(ENVTEST_ASSETS_DIR); go test ./... -coverprofile cover.out

##@ Build
release-build: build generate bundle docker-build bundle-build catalog-build ## Build operator docker, bundle, catalog images
release-build: build generate bundle docker-build bundle-build bundle-push catalog-build ## Build operator docker, bundle, catalog images

build: generate fmt vet ## Build manager binary.
go build -o bin/manager main.go
Expand Down Expand Up @@ -213,10 +240,14 @@ endif

# A comma-separated list of bundle images (e.g. make catalog-build BUNDLE_IMGS=example.com/operator-bundle:v0.1.0,example.com/operator-bundle:v0.2.0).
# These images MUST exist in a registry and be pull-able.
ifeq ($(OLD_BUNDLE_IMGS),)
BUNDLE_IMGS ?= $(BUNDLE_IMG)
else
BUNDLE_IMGS ?= $(BUNDLE_IMG),$(OLD_BUNDLE_IMGS)
endif

# The image tag given to the resulting catalog image (e.g. make catalog-build CATALOG_IMG=example.com/operator-catalog:v0.2.0).
CATALOG_IMG ?= $(IMAGE_TAG_BASE)-catalog:v$(VERSION)
CATALOG_IMG ?= $(IMAGE_TAG_BASE)-catalog:v$(CATALOG_VERSION)

This comment has been minimized.

Copy link
@fOO223Fr

fOO223Fr Oct 12, 2021

Contributor

This change did not help me. i am failing to build catalog image


# Set CATALOG_BASE_IMG to an existing catalog image tag to add $BUNDLE_IMGS to that image.
ifneq ($(origin CATALOG_BASE_IMG), undefined)
Expand Down
10 changes: 6 additions & 4 deletions bundle/manifests/dbaas-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ metadata:
]
capabilities: Basic Install
categories: Database
containerImage: quay.io/ecosystem-appeng/dbaas-operator:latest
containerImage: quay.io/ecosystem-appeng/dbaas-operator:v0.1.2
description: Discover & connect with database instances hosted on 3rd-party ISV
cloud platforms.
operatorframework.io/suggested-namespace: openshift-dbaas-operator
Expand All @@ -123,7 +123,7 @@ metadata:
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
repository: https://github.com/RHEcosystemAppEng/dbaas-operator
support: [email protected]
name: dbaas-operator.v0.1.1
name: dbaas-operator.v0.1.2
namespace: placeholder
spec:
apiservicedefinitions: {}
Expand Down Expand Up @@ -438,7 +438,8 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
image: quay.io/ecosystem-appeng/dbaas-operator:v0.1.1
image: quay.io/ecosystem-appeng/dbaas-operator:v0.1.2
imagePullPolicy: Always
livenessProbe:
httpGet:
path: /healthz
Expand Down Expand Up @@ -525,7 +526,8 @@ spec:
provider:
name: Red Hat
url: https://www.redhat.com
version: 0.1.1
replaces: dbaas-operator.v0.1.1
version: 0.1.2
webhookdefinitions:
- admissionReviewVersions:
- v1
Expand Down
2 changes: 1 addition & 1 deletion config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ kind: Kustomization
images:
- name: controller
newName: quay.io/ecosystem-appeng/dbaas-operator
newTag: v0.1.1
newTag: v0.1.2
1 change: 1 addition & 0 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ spec:
- --leader-elect
image: controller:latest
name: manager
imagePullPolicy: Always
securityContext:
allowPrivilegeEscalation: false
livenessProbe:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
alm-examples: '[]'
capabilities: Basic Install
categories: Database
containerImage: quay.io/ecosystem-appeng/dbaas-operator:latest
containerImage: quay.io/ecosystem-appeng/dbaas-operator:v0.1.2
description: Discover & connect with database instances hosted on 3rd-party ISV
cloud platforms.
operatorframework.io/suggested-namespace: openshift-dbaas-operator
Expand Down Expand Up @@ -138,4 +138,5 @@ spec:
provider:
name: Red Hat
url: https://www.redhat.com
replaces: dbaas-operator.v0.1.1
version: 0.0.0
2 changes: 1 addition & 1 deletion config/samples/catalog-source.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ metadata:
namespace: openshift-marketplace
spec:
sourceType: grpc
image: quay.io/ecosystem-appeng/dbaas-operator-catalog:v0.0.7
image: quay.io/ecosystem-appeng/dbaas-operator-catalog:v0.1
displayName: DBaaS Operator
50 changes: 50 additions & 0 deletions config/samples/quarkus-crunchydata-sample-app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
apiVersion: v1
kind: List
items:
- kind: Deployment
apiVersion: apps/v1
metadata:
name: postgresql-orm-quarkus
spec:
replicas: 1
selector:
matchLabels:
name: postgresql-orm-quarkus
template:
metadata:
labels:
name: postgresql-orm-quarkus
spec:
containers:
- name: postgresql-orm-quarkus
# Replace this with the built image name
image: quay.io/ecosystem-appeng/postgresql-orm-quarkus:v0.1
imagePullPolicy: Always
ports:
- containerPort: 8080
protocol: TCP
- kind: Service
apiVersion: v1
metadata:
name: postgresql-orm-quarkus
labels:
name: postgresql-orm-quarkus
spec:
ports:
- port: 8080
protocol: TCP
targetPort: 8080
selector:
name: postgresql-orm-quarkus
- kind: Route
apiVersion: route.openshift.io/v1
metadata:
name: postgresql-orm-quarkus
labels:
name: postgresql-orm-quarkus
spec:
port:
targetPort: 8080
to:
kind: Service
name: postgresql-orm-quarkus
49 changes: 49 additions & 0 deletions config/samples/quarkus-mongodb-sample-app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
apiVersion: v1
kind: List
items:
- kind: Deployment
apiVersion: apps/v1
metadata:
name: fruit-shop
spec:
replicas: 1
selector:
matchLabels:
name: fruit-shop
template:
metadata:
labels:
name: fruit-shop
spec:
containers:
- name: fruit-shop
image: quay.io/ecosystem-appeng/mongo-quickstart:0.0.1-SNAPSHOT
imagePullPolicy: Always
ports:
- containerPort: 8080
protocol: TCP
- kind: Service
apiVersion: v1
metadata:
name: fruit-shop
labels:
name: fruit-shop
spec:
ports:
- port: 8080
protocol: TCP
targetPort: 8080
selector:
name: fruit-shop
- kind: Route
apiVersion: route.openshift.io/v1
metadata:
name: fruit-shop
labels:
name: fruit-shop
spec:
port:
targetPort: 8080
to:
kind: Service
name: fruit-shop

0 comments on commit e2bd90f

Please sign in to comment.