Skip to content

Commit

Permalink
chore: test that different deployed in / watched namespaces works
Browse files Browse the repository at this point in the history
  • Loading branch information
metacosm committed Dec 12, 2022
1 parent ac1dd65 commit 8c0075f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions samples/exposedapp/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
#quarkus.container-image.name=expose-operator
# set to true to automatically apply CRDs to the cluster when they get regenerated
quarkus.operator-sdk.crd.apply=true
# test values to check RBACs
%test.quarkus.kubernetes.namespace=opns
%test.quarkus.operator-sdk.controllers.exposedapp.namespaces=crns
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,18 @@ void reconcileShouldWork() {

final var app = new ExposedApp();
final var client = mockServer.getClient();
final String namespace = client.getNamespace();

// use namespace name define in application.properties for test profile
final String namespace = "crns";

final var metadata = new ObjectMetaBuilder()
.withName("test-app")
.withNamespace(namespace)
.build();
app.setMetadata(metadata);
app.getSpec().setImageRef("group/imageName:tag");

client.resource(app).inNamespace(namespace).create();
client.resource(app).create();

await().ignoreException(NullPointerException.class).atMost(10, TimeUnit.SECONDS).untilAsserted(() -> {
// check that we create the deployment
Expand Down

0 comments on commit 8c0075f

Please sign in to comment.