From c0562c4651f031b54b94ff7cbb4452bba91ef3a6 Mon Sep 17 00:00:00 2001 From: Jakub Cechacek Date: Mon, 25 Sep 2023 12:28:37 +0200 Subject: [PATCH] DBZ-6738 Adjusting for the latest QOSDK release and fixes comming with it --- .gitignore | 6 +- k8/kubernetes.yml | 4 - olm/bundles/README.md | 8 - pom.xml | 171 +++++++----------- src/main/assemblies/olm.xml | 33 ++++ .../assembly.xml => assemblies/operator.xml} | 0 .../operator/DebeziumCsvMetadata.java | 17 +- .../operator/DebeziumServerReconciler.java | 2 +- 8 files changed, 112 insertions(+), 129 deletions(-) delete mode 100644 olm/bundles/README.md create mode 100644 src/main/assemblies/olm.xml rename src/main/{resources/assembly.xml => assemblies/operator.xml} (100%) diff --git a/.gitignore b/.gitignore index fa0c1be..bf781c7 100644 --- a/.gitignore +++ b/.gitignore @@ -43,8 +43,4 @@ nb-configuration.xml /.quarkus/cli/plugins/ # kubernetes -kubernetes.json - -# OLM build workspace -olm/* -!olm/bundles \ No newline at end of file +kubernetes.json \ No newline at end of file diff --git a/k8/kubernetes.yml b/k8/kubernetes.yml index 5336f0e..171c7a9 100644 --- a/k8/kubernetes.yml +++ b/k8/kubernetes.yml @@ -151,10 +151,6 @@ spec: port: 80 protocol: TCP targetPort: 8080 - - name: https - port: 443 - protocol: TCP - targetPort: 8443 selector: app.kubernetes.io/name: debezium-operator type: ClusterIP diff --git a/olm/bundles/README.md b/olm/bundles/README.md deleted file mode 100644 index 8174be5..0000000 --- a/olm/bundles/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Debezium Operator OLM Bundle Manifests -For main branch this directory is expected to be empty. For release branches the raw OLM bundle manifests should be located here. - -_Note that such OLM bundle requires further processing and without it the bundle is not usable._ - -To release this bundle follow the instruction is [Operator Bundle Manifests repository](https://github.com/debezium/debezium-operator-manifests). - - diff --git a/pom.xml b/pom.xml index 5a35649..ad3b028 100644 --- a/pom.xml +++ b/pom.xml @@ -36,34 +36,42 @@ 3.3.1 0.43.4 - 3.24.2 + + debezium-operator.v${olm.bundle.version} + alpha + ${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}-nightly + + ${quarkus.container-image.registry}/${quarkus.container-image.group}/${quarkus.container-image.name}:${quarkus.container-image.tag} + ${maven.build.timestamp} + debezium-operator + quarkus-bom io.quarkus 3.2.4.Final - 6.3.0 + 6.3.3 false + ${olm.bundle.version} + ${olm.bundle.replaces} + ${olm.bundle.package.name} quay.io debezium operator nightly debezium-operator - - ${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.x - ${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}-nightly - debezium-operator.v${olm.bundle.version} - - ${quarkus.container-image.registry}/${quarkus.container-image.group}/${quarkus.container-image.name}:${quarkus.container-image.tag} - ${maven.build.timestamp} + true + 17 ${quarkus.container-image.tag} + + $$ @@ -203,6 +211,32 @@ + + org.apache.maven.plugins + maven-resources-plugin + ${version.resources.plugin} + + + olm-bundle-process + package + + copy-resources + + + ${project.build.directory}/olm/bundles/${olm.bundle.name} + + + + ${project.build.directory}/bundle/${dollar}{olm.bundle.name} + **/* + true + + + true + + + + @@ -223,104 +257,22 @@ stable ${project.parent.version} - debezium-${version.debezium.channel} + ${olm.bundle.channels} ${project.parent.version} + debezium-${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.x - olmStable + + olmLatest - debezium-stable,debezium-${version.debezium.channel} + debezium-latest,${olm.bundle.channels} - - olmUpdate - - true - - $$ - - - - - org.apache.maven.plugins - maven-resources-plugin - ${version.resources.plugin} - - - copy-olm - package - - copy-resources - - - ${project.basedir}/olm/bundles/${olm.bundle.version} - - - - ${project.build.directory}/bundle/${dollar}{olm.bundle.name} - **/* - true - - - true - - - - - - - - - - - io.fabric8 - docker-maven-plugin - ${version.docker.maven.plugin} - - - - yq - mikefarah/yq:latest - - true - - - ${project.basedir}/olm/bundles/${olm.bundle.version}:/workdir - - - - - ea - -i - .spec.install.spec.deployments[0].spec.template.spec.containers[0].env += [{"name": "QUARKUS_OPERATOR_SDK_NAMESPACES", "valueFrom": {"fieldRef": {"fieldPath": "metadata.annotations['olm.targetNamespaces']"}}}] - manifests/${olm.bundle.name}.clusterserviceversion.yaml - - - - - - - - - wire-olm - package - - start - - - - - - - k8update - - true - @@ -375,20 +327,35 @@ maven-assembly-plugin ${version.assembly.plugin} - false - true - - src/main/resources/assembly.xml - + true posix - distribution + operator-package package single + + false + + src/main/assemblies/operator.xml + + + + + olm-bundle-package + package + + single + + + true + + src/main/assemblies/olm.xml + + diff --git a/src/main/assemblies/olm.xml b/src/main/assemblies/olm.xml new file mode 100644 index 0000000..8710302 --- /dev/null +++ b/src/main/assemblies/olm.xml @@ -0,0 +1,33 @@ + + olm-bundle + + tar.gz + zip + + + false + + + + ${project.basedir}. + + + README* + CHANGELOG* + CONTRIBUTE* + COPYRIGHT* + LICENSE* + + true + + + ${project.build.directory}/olm/bundles/ + . + + **/** + + + + \ No newline at end of file diff --git a/src/main/resources/assembly.xml b/src/main/assemblies/operator.xml similarity index 100% rename from src/main/resources/assembly.xml rename to src/main/assemblies/operator.xml diff --git a/src/main/java/io/debezium/operator/DebeziumCsvMetadata.java b/src/main/java/io/debezium/operator/DebeziumCsvMetadata.java index 5c2a128..9d81bf3 100644 --- a/src/main/java/io/debezium/operator/DebeziumCsvMetadata.java +++ b/src/main/java/io/debezium/operator/DebeziumCsvMetadata.java @@ -5,20 +5,19 @@ */ package io.debezium.operator; -import io.quarkiverse.operatorsdk.bundle.runtime.CSVMetadata; -import io.quarkiverse.operatorsdk.bundle.runtime.CSVMetadata.Annotations; -import io.quarkiverse.operatorsdk.bundle.runtime.CSVMetadata.Icon; -import io.quarkiverse.operatorsdk.bundle.runtime.CSVMetadata.InstallMode; -import io.quarkiverse.operatorsdk.bundle.runtime.CSVMetadata.Link; -import io.quarkiverse.operatorsdk.bundle.runtime.CSVMetadata.Maintainer; -import io.quarkiverse.operatorsdk.bundle.runtime.CSVMetadata.Provider; -import io.quarkiverse.operatorsdk.bundle.runtime.SharedCSVMetadata; +import io.quarkiverse.operatorsdk.annotations.CSVMetadata; +import io.quarkiverse.operatorsdk.annotations.CSVMetadata.Annotations; +import io.quarkiverse.operatorsdk.annotations.CSVMetadata.Icon; +import io.quarkiverse.operatorsdk.annotations.CSVMetadata.InstallMode; +import io.quarkiverse.operatorsdk.annotations.CSVMetadata.Link; +import io.quarkiverse.operatorsdk.annotations.CSVMetadata.Maintainer; +import io.quarkiverse.operatorsdk.annotations.CSVMetadata.Provider; +import io.quarkiverse.operatorsdk.annotations.SharedCSVMetadata; // @formatter:off @CSVMetadata( name = DebeziumCsvMetadata.NAME, displayName = "Debezium Operator", - version = "${olm.bundle.version}", replaces = "${olm.bundle.replaces}", icon = @Icon(fileName = "debezium-icon.svg"), provider = @Provider(name = "Debezium Authors", url = "https://debezium.io/"), maintainers = @Maintainer(name = "Debezium Authors", email = "debezium@googlegroups.com"), diff --git a/src/main/java/io/debezium/operator/DebeziumServerReconciler.java b/src/main/java/io/debezium/operator/DebeziumServerReconciler.java index 7374cd7..4743c49 100644 --- a/src/main/java/io/debezium/operator/DebeziumServerReconciler.java +++ b/src/main/java/io/debezium/operator/DebeziumServerReconciler.java @@ -23,7 +23,7 @@ import io.javaoperatorsdk.operator.api.reconciler.Reconciler; import io.javaoperatorsdk.operator.api.reconciler.UpdateControl; import io.javaoperatorsdk.operator.api.reconciler.dependent.Dependent; -import io.quarkiverse.operatorsdk.bundle.runtime.CSVMetadata; +import io.quarkiverse.operatorsdk.annotations.CSVMetadata; import io.quarkus.logging.Log; @ControllerConfiguration(namespaces = Constants.WATCH_CURRENT_NAMESPACE, name = "debeziumserver", dependents = {