Skip to content

Commit

Permalink
CRD generator fix
Browse files Browse the repository at this point in the history
  • Loading branch information
csviri committed Jul 25, 2022
1 parent 3590a8c commit e194e01
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 27 deletions.
2 changes: 0 additions & 2 deletions operator-framework-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,10 @@


<dependencies>
<!-- We use the OpenShift client, because functionally it is a superset of the Kubernetes client -->
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-client</artifactId>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
Expand Down
5 changes: 5 additions & 0 deletions operator-framework/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@
<artifactId>crd-generator-apt</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>crd-generator-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,23 +66,24 @@ public void setKubernetesClient(KubernetesClient kubernetesClient) {
public DeleteControl cleanup(
TestCustomResource resource, Context<TestCustomResource> context) {
numberOfCleanupExecutions.incrementAndGet();
Boolean delete =
kubernetesClient
.configMaps()
.inNamespace(resource.getMetadata().getNamespace())
.withName(resource.getSpec().getConfigMapName())
.delete();
if (delete) {
log.info(
"Deleted ConfigMap {} for resource: {}",
resource.getSpec().getConfigMapName(),
resource.getMetadata().getName());
} else {
log.error(
"Failed to delete ConfigMap {} for resource: {}",
resource.getSpec().getConfigMapName(),
resource.getMetadata().getName());
}

var statusDetail = kubernetesClient
.configMaps()
.inNamespace(resource.getMetadata().getNamespace())
.withName(resource.getSpec().getConfigMapName())
.delete();
// todo
// if (delete) {
log.info(
"Deleted ConfigMap {} for resource: {}",
resource.getSpec().getConfigMapName(),
resource.getMetadata().getName());
// } else {
// log.error(
// "Failed to delete ConfigMap {} for resource: {}",
// resource.getSpec().getConfigMapName(),
// resource.getMetadata().getName());
// }
return DeleteControl.defaultDelete();
}

Expand Down
23 changes: 16 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>${junit.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-client-bom</artifactId>
Expand All @@ -93,13 +100,16 @@
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>${junit.version}</version>
<type>pom</type>
<scope>import</scope>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-server-mock</artifactId>
<version>${fabric8-client.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-client</artifactId>
<version>${fabric8-client.version}</version>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
Expand All @@ -115,7 +125,6 @@
<artifactId>micrometer-core</artifactId>
<version>${micrometer-core.version}</version>
</dependency>

<dependency>
<groupId>com.squareup</groupId>
<artifactId>javapoet</artifactId>
Expand Down
4 changes: 4 additions & 0 deletions sample-operators/mysql-schema/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@
<artifactId>crd-generator-apt</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>crd-generator-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
Expand Down
4 changes: 4 additions & 0 deletions sample-operators/tomcat-operator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
<artifactId>crd-generator-apt</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>crd-generator-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
Expand Down
4 changes: 4 additions & 0 deletions sample-operators/webpage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
<artifactId>crd-generator-apt</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>crd-generator-api</artifactId>
</dependency>
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
Expand Down
5 changes: 4 additions & 1 deletion smoke-test-samples/common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@
<artifactId>crd-generator-apt</artifactId>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>io.fabric8</groupId>
<artifactId>crd-generator-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
Expand Down

0 comments on commit e194e01

Please sign in to comment.