Skip to content

Commit ba425cc

Browse files
authored
DEVX-1193 Allows for override of Operator revision, defaults to 0 (#45)
1 parent 757b45a commit ba425cc

File tree

4 files changed

+22
-14
lines changed

4 files changed

+22
-14
lines changed

Dockerfile-operator

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
# limitations under the License.
1515

1616
ARG CP_VERSION
17+
ARG OPERATOR_VERSION
1718

18-
FROM confluentinc/cp-server-connect-operator:${CP_VERSION}.0
19+
FROM confluentinc/cp-server-connect-operator:${CP_VERSION}.${OPERATOR_VERSION}
1920

2021
ARG KAFKA_CONNECT_DATAGEN_VERSION
2122

Dockerfile-operator-local

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
# limitations under the License.
1515

1616
ARG CP_VERSION
17+
ARG OPERATOR_VERSION
1718

18-
FROM confluentinc/cp-server-connect-operator:${CP_VERSION}.0
19+
FROM confluentinc/cp-server-connect-operator:${CP_VERSION}.${OPERATOR_VERSION}
1920

2021
ARG KAFKA_CONNECT_DATAGEN_VERSION
2122

Makefile

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@ check-dependencies:
1616
@#(call check-dependency,sed)
1717

1818
CP_VERSION ?= 5.3.1
19+
OPERATOR_VERSION ?= 0
20+
1921
KAFKA_CONNECT_DATAGEN_VERSION ?= 0.1.6
2022
AGGREGATE_VERSION = $(KAFKA_CONNECT_DATAGEN_VERSION)-$(CP_VERSION)
23+
OPERATOR_AGGREGATE_VERSION = $(AGGREGATE_VERSION).$(OPERATOR_VERSION)
2124

2225
KAFKA_CONNECT_DATAGEN_LOCAL_VERSION = $(shell make local-package-version)
2326
AGGREGATE_LOCAL_VERSION = $(KAFKA_CONNECT_DATAGEN_LOCAL_VERSION)-$(CP_VERSION)
@@ -41,18 +44,14 @@ publish-cp-kafka-connect-confluenthub: check-dependencies ## Build the cp-kafka-
4144
@docker build -t cnfldemos/kafka-connect-datagen:$(AGGREGATE_VERSION) --build-arg KAFKA_CONNECT_DATAGEN_VERSION=$(KAFKA_CONNECT_DATAGEN_VERSION) --build-arg CP_VERSION=$(CP_VERSION) -f Dockerfile-confluenthub .
4245
@docker push cnfldemos/kafka-connect-datagen:$(AGGREGATE_VERSION)
4346

44-
#######################################################################################
45-
# Note on Operator version numbers. Operator overlays functionality on CP images,
46-
# resulting in images that look like: 5.3.1.0, giving them the option to rev
47-
# operator independently of CP. For right now, I (Rick) just added `.0`
48-
# strings to the end of the docker tags below just to move on, but if CP engineering
49-
# releases sub-versions of Operator on top of standard CP versions, we'll need to
50-
# automate this appropriately or fix up manually and publish images
51-
#######################################################################################
47+
# The combination of CP_VERSION & OPERATOR_VERSION will determine two things:
48+
# 1. The version of the operator base image used in the Dockerfiles for operator (Dockerfile-operator-local & Dockerfile-operator)
49+
# 2. The version of the docker images _this_ repository builds and pushes to cnfldemos (cp-server-connect-operator-with-datagen)
50+
5251
publish-cp-server-connect-operator-confluenthub: check-dependencies ## Build the cp-server-connect-operator image pulling datagen from Confluent Hub
53-
@docker build -t cnfldemos/cp-server-connect-operator-with-datagen:$(AGGREGATE_VERSION).0 --build-arg KAFKA_CONNECT_DATAGEN_VERSION=$(KAFKA_CONNECT_DATAGEN_VERSION) --build-arg CP_VERSION=$(CP_VERSION) -f Dockerfile-operator .
54-
@docker push cnfldemos/cp-server-connect-operator-with-datagen:$(AGGREGATE_VERSION).0
52+
@docker build -t cnfldemos/cp-server-connect-operator-with-datagen:$(AGGREGATE_VERSION).0 --build-arg KAFKA_CONNECT_DATAGEN_VERSION=$(KAFKA_CONNECT_DATAGEN_VERSION) --build-arg CP_VERSION=$(CP_VERSION) --build-arg OPERATOR_VERSION=$(OPERATOR_VERSION) -f Dockerfile-operator .
53+
@docker push cnfldemos/cp-server-connect-operator-with-datagen:$(OPERATOR_AGGREGATE_VERSION)
5554

5655
publish-cp-server-connect-operator-local: check-dependencies ## Build the cp-server-connect-operator image installing datagen from the local build
57-
@docker build -t cnfldemos/cp-server-connect-operator-with-datagen:$(AGGREGATE_VERSION).0 --build-arg KAFKA_CONNECT_DATAGEN_VERSION=$(KAFKA_CONNECT_DATAGEN_VERSION) --build-arg CP_VERSION=$(CP_VERSION) -f Dockerfile-operator-local .
58-
@docker push cnfldemos/cp-server-connect-operator-with-datagen:$(AGGREGATE_VERSION).0
56+
@docker build -t cnfldemos/cp-server-connect-operator-with-datagen:$(AGGREGATE_VERSION).0 --build-arg KAFKA_CONNECT_DATAGEN_VERSION=$(KAFKA_CONNECT_DATAGEN_VERSION) --build-arg CP_VERSION=$(CP_VERSION) --build-arg OPERATOR_VERSION=$(OPERATOR_VERSION) -f Dockerfile-operator-local .
57+
@docker push cnfldemos/cp-server-connect-operator-with-datagen:$(OPERATOR_AGGREGATE_VERSION)

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ The [Makefile](Makefile) contains some default variables that affect the version
194194
```bash
195195
CP_VERSION ?= 5.3.1
196196
KAFKA_CONNECT_DATAGEN_VERSION ?= 0.1.6
197+
OPERATOR_VERSION ?= 0 # Operator is a 'rev' version appended at the end of the CP version, like so: 5.3.1.0
197198
```
198199

199200
To publish the https://hub.docker.com/r/cnfldemos/kafka-connect-datagen/ image:
@@ -206,6 +207,12 @@ and to override the CP Version of the `kafka-connect-datagen` version you can ru
206207
CP_VERSION=5.3.0 KAFKA_CONNECT_DATAGEN_VERSION=0.1.4 make publish-cp-kafka-connect-confluenthub
207208
```
208209

210+
to override the CP Version and the Operator version, which may happen if Operator releases a patch version, you could run something similar to:
211+
```bash
212+
CP_VERSION=5.3.0 OPERATOR_VERSION=1 KAFKA_CONNECT_DATAGEN_VERSION=0.1.4 make publish-cp-server-connect-operator-confluenthub
213+
```
214+
which would result in a docker image tagged as: `cp-server-connect-operator-with-datagen:0.1.4-5.3.0.1`
215+
209216
To publish the https://hub.docker.com/r/cnfldemos/cp-server-connect-operator-with-datagen image:
210217
```bash
211218
make publish-cp-server-connect-operator-confluenthub

0 commit comments

Comments
 (0)