Skip to content

Fabric8 CRD JsonNode generator reproducer #2887

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions operator-framework/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@
<artifactId>openshift-client-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>crd-generator-api-v2</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j2-impl</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.javaoperatorsdk.operator.baseapi.simple;

import java.time.Duration;
import java.util.Map;
import java.util.concurrent.TimeUnit;

import org.junit.jupiter.api.Test;
Expand All @@ -10,6 +11,8 @@
import io.javaoperatorsdk.operator.junit.LocallyRunOperatorExtension;
import io.javaoperatorsdk.operator.support.TestUtils;

import com.fasterxml.jackson.databind.ObjectMapper;

import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;

Expand All @@ -21,10 +24,12 @@ class ReconcilerExecutorIT {

@Test
void configMapGetsCreatedForTestCustomResource() {
var om = new ObjectMapper();
operator.getReconcilerOfType(TestReconciler.class).setUpdateStatus(true);

TestCustomResource resource = TestUtils.testCustomResource();
operator.create(resource);
resource.getSpec().setSomeValue(om.valueToTree(Map.of("k", "v")));
var res = operator.create(resource);

awaitResourcesCreatedOrUpdated();
awaitStatusUpdated();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.javaoperatorsdk.operator.baseapi.simple;

import com.fasterxml.jackson.databind.JsonNode;

public class TestCustomResourceSpec {

private String configMapName;
Expand All @@ -8,6 +10,16 @@ public class TestCustomResourceSpec {

private String value;

private JsonNode someValue;

public JsonNode getSomeValue() {
return someValue;
}

public void setSomeValue(JsonNode value) {
this.someValue = value;
}

public String getConfigMapName() {
return configMapName;
}
Expand Down