Skip to content

Commit

Permalink
DBZ-6738 Adjusting for the latest QOSDK release and fixes comming wit…
Browse files Browse the repository at this point in the history
…h it
  • Loading branch information
jcechace committed Sep 25, 2023
1 parent ce958eb commit 7c2bde7
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 125 deletions.
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,4 @@ nb-configuration.xml
/.quarkus/cli/plugins/

# kubernetes
kubernetes.json

# OLM build workspace
olm/*
!olm/bundles
kubernetes.json
8 changes: 0 additions & 8 deletions olm/bundles/README.md

This file was deleted.

171 changes: 69 additions & 102 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,34 +36,42 @@
<version.resources.plugin>3.3.1</version.resources.plugin>
<version.docker.maven.plugin>0.43.4</version.docker.maven.plugin>


<!-- Dependency versions -->
<version.assertj>3.24.2</version.assertj>

<!-- OLM configuration -->
<olm.bundle.name>debezium-operator.v${olm.bundle.version}</olm.bundle.name>
<olm.bundle.channels>alpha</olm.bundle.channels>
<olm.bundle.version>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}-nightly</olm.bundle.version>
<olm.bundle.replaces></olm.bundle.replaces>
<olm.bundle.containerImage>${quarkus.container-image.registry}/${quarkus.container-image.group}/${quarkus.container-image.name}:${quarkus.container-image.tag}</olm.bundle.containerImage>
<olm.bundle.createdAt>${maven.build.timestamp}</olm.bundle.createdAt>
<olm.bundle.package.name>debezium-operator</olm.bundle.package.name>

<!-- Quarkus configuration and versions-->
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
<quarkus.platform.version>3.2.4.Final</quarkus.platform.version>
<quarkus.operator.sdk.version>6.3.0</quarkus.operator.sdk.version>
<quarkus.operator.sdk.version>6.3.3</quarkus.operator.sdk.version>

<!-- Operator and Image configuration -->
<quarkus.operator-sdk.crd.validate>false</quarkus.operator-sdk.crd.validate>
<quarkus.operator-sdk.bundle.version>${olm.bundle.version}</quarkus.operator-sdk.bundle.version>
<quarkus.operator-sdk.bundle.version.replaces>${olm.bundle.replaces}</quarkus.operator-sdk.bundle.version.replaces>
<quarkus.operator-sdk.bundle.package-name>${olm.bundle.package.name}</quarkus.operator-sdk.bundle.package-name>
<quarkus.container-image.registry>quay.io</quarkus.container-image.registry>
<quarkus.container-image.group>debezium</quarkus.container-image.group>
<quarkus.container-image.name>operator</quarkus.container-image.name>
<quarkus.container-image.tag>nightly</quarkus.container-image.tag>
<quarkus.kubernetes.name>debezium-operator</quarkus.kubernetes.name>
<!-- OLM configuration -->
<version.debezium.channel>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.x</version.debezium.channel>
<olm.bundle.version>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}-nightly</olm.bundle.version>
<olm.bundle.name>debezium-operator.v${olm.bundle.version}</olm.bundle.name>
<olm.bundle.replaces></olm.bundle.replaces>
<olm.bundle.containerImage>${quarkus.container-image.registry}/${quarkus.container-image.group}/${quarkus.container-image.name}:${quarkus.container-image.tag}</olm.bundle.containerImage>
<olm.bundle.createdAt>${maven.build.timestamp}</olm.bundle.createdAt>
<quarkus.kubernetes.idempotent>true</quarkus.kubernetes.idempotent>

<!-- Formatting configuration -->
<format.imports.source.compliance>17</format.imports.source.compliance>
<!-- Example properties -->
<examples.image.tag>${quarkus.container-image.tag}</examples.image.tag>
<!-- Outputting dollar sign has to be done through property-->
<dollar>$$</dollar>
</properties>

<repositories>
Expand Down Expand Up @@ -203,6 +211,32 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>${version.resources.plugin}</version>
<executions>
<execution>
<id>olm-bundle-process</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/olm/bundles/${olm.bundle.name}</outputDirectory>
<resources>
<resource>
<!-- Outputting ${olm.bundle.name} without actually expanding the property -->
<directory>${project.build.directory}/bundle/${dollar}{olm.bundle.name}</directory>
<include>**/*</include>
<filtering>true</filtering>
</resource>
</resources>
<fileNameFiltering>true</fileNameFiltering>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand All @@ -223,104 +257,22 @@
<id>stable</id>
<properties>
<quarkus.container-image.tag>${project.parent.version}</quarkus.container-image.tag>
<quarkus.operator-sdk.bundle.channels>debezium-${version.debezium.channel}</quarkus.operator-sdk.bundle.channels>
<quarkus.operator-sdk.bundle.channels>${olm.bundle.channels}</quarkus.operator-sdk.bundle.channels>
<olm.bundle.version>${project.parent.version}</olm.bundle.version>
<olm.bundle.channels>debezium-${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.x</olm.bundle.channels>
</properties>
</profile>
<profile>
<!-- This must be defined later than stable profile to ensure correct property resolution!!! -->
<!-- See: https://maven.apache.org/guides/introduction/introduction-to-profiles.html#profile-order -->
<id>olmStable</id>
<!-- The purpose of this channel is to release the OLM bundle into the debezium-latest OLM channel -->
<id>olmLatest</id>
<properties>
<quarkus.operator-sdk.bundle.channels>debezium-stable,debezium-${version.debezium.channel}</quarkus.operator-sdk.bundle.channels>
<quarkus.operator-sdk.bundle.channels>debezium-latest,${olm.bundle.channels}</quarkus.operator-sdk.bundle.channels>
</properties>
</profile>
<profile>
<id>olmUpdate</id>
<properties>
<quarkus.kubernetes.idempotent>true</quarkus.kubernetes.idempotent>
<!-- Outputting dollar sign has to be done through property-->
<dollar>$$</dollar>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>${version.resources.plugin}</version>
<executions>
<execution>
<id>copy-olm</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.basedir}/olm/bundles/${olm.bundle.version}</outputDirectory>
<resources>
<resource>
<!-- Outputting ${olm.bundle.name} without actually expanding the property -->
<directory>${project.build.directory}/bundle/${dollar}{olm.bundle.name}</directory>
<include>**/*</include>
<filtering>true</filtering>
</resource>
</resources>
<fileNameFiltering>true</fileNameFiltering>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<!-- Wire OLM target namespaces and QOSDK configuration together-->
<!-- Required since QOSDK doesn't generate this!-->
<!-- OLM standard is to set the olm.targetNamespaces annotation on operator deployments-->
<!-- whereas QOSDK uses the QUARKUS_OPERATOR_SDK_NAMESPACES environment variable for the same purpose-->
<!-- This runs yq container and adds the variable to operator deployment in generated CSV-->
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>${version.docker.maven.plugin}</version>
<configuration>
<images>
<image>
<alias>yq</alias>
<name>mikefarah/yq:latest</name>
<run>
<autoRemove>true</autoRemove>
<volumes>
<bind>
<volume>${project.basedir}/olm/bundles/${olm.bundle.version}:/workdir</volume>
</bind>
</volumes>
<cmd>
<exec>
<arg>ea</arg>
<arg>-i</arg>
<arg>.spec.install.spec.deployments[0].spec.template.spec.containers[0].env += [{"name": "QUARKUS_OPERATOR_SDK_NAMESPACES", "valueFrom": {"fieldRef": {"fieldPath": "metadata.annotations['olm.targetNamespaces']"}}}]</arg>
<arg>manifests/${olm.bundle.name}.clusterserviceversion.yaml</arg>
</exec>
</cmd>
</run>
</image>
</images>
</configuration>
<executions>
<execution>
<id>wire-olm</id>
<phase>package</phase>
<goals>
<goal>start</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>k8update</id>
<properties>
<quarkus.kubernetes.idempotent>true</quarkus.kubernetes.idempotent>
</properties>
<build>
<plugins>
<plugin>
Expand Down Expand Up @@ -375,20 +327,35 @@
<artifactId>maven-assembly-plugin</artifactId>
<version>${version.assembly.plugin}</version>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<attach>true</attach> <!-- we want attach & deploy these to Maven -->
<descriptors>
<descriptor>src/main/resources/assembly.xml</descriptor>
</descriptors>
<attach>true</attach> <!-- we want to attach & deploy these to Maven -->
<tarLongFileMode>posix</tarLongFileMode>
</configuration>
<executions>
<execution>
<id>distribution</id>
<id>operator-package</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/main/assemblies/operator.xml</descriptor>
</descriptors>
</configuration>
</execution>
<execution>
<id>olm-bundle-package</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<appendAssemblyId>true</appendAssemblyId>
<descriptors>
<descriptor>src/main/assemblies/olm.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
Expand Down
33 changes: 33 additions & 0 deletions src/main/assemblies/olm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.2.0 https://maven.apache.org/xsd/assembly-2.2.0.xsd">
<id>olm-bundle</id>
<formats>
<format>tar.gz</format>
<format>zip</format>
</formats>

<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<!-- Get the files from the top-level directory -->
<directory>${project.basedir}.</directory>
<!-- <outputDirectory>${project.artifactId}</outputDirectory>-->
<includes>
<include>README*</include>
<include>CHANGELOG*</include>
<include>CONTRIBUTE*</include>
<include>COPYRIGHT*</include>
<include>LICENSE*</include>
</includes>
<useDefaultExcludes>true</useDefaultExcludes>
</fileSet>
<fileSet>
<directory>${project.build.directory}/olm/bundles/</directory>
<outputDirectory>.</outputDirectory>
<includes>
<include>**/**</include>
</includes>
</fileSet>
</fileSets>
</assembly>
File renamed without changes.
17 changes: 8 additions & 9 deletions src/main/java/io/debezium/operator/DebeziumCsvMetadata.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "[email protected]"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 7c2bde7

Please sign in to comment.