Skip to content

Commit

Permalink
Fix(testsuite): CRD not found exception
Browse files Browse the repository at this point in the history
  • Loading branch information
rkubis committed Jan 7, 2025
1 parent 2e22e22 commit cea2585
Showing 1 changed file with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.apicurio.registry.systemtests.platform;

import io.apicur.registry.v1.ApicurioRegistry3;
import io.apicurio.registry.systemtests.framework.LoggerUtils;
import io.apicurio.registry.systemtests.framework.OperatorUtils;
import io.fabric8.kubernetes.api.model.HasMetadata;
import io.fabric8.kubernetes.api.model.KubernetesResourceList;
Expand Down Expand Up @@ -97,10 +98,22 @@ public static List<HasMetadata> loadFromDirectory(Path path) {
}

public static void createOrReplaceResources(String namespace, Collection<HasMetadata> resourcesList) {
getClient()
.resourceList(resourcesList)
.inNamespace(namespace)
.createOrReplace();
for (HasMetadata hasMetadata : resourcesList) {
LoggerUtils.getLogger().info("Creating {}...", hasMetadata.getKind());

getClient()
.resource(hasMetadata)
.inNamespace(namespace)
.serverSideApply();

if (hasMetadata.getKind().equals("CustomResourceDefinition")) {
try {
Thread.sleep(5_000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
}
}

public static void deleteResources(String namespace, Collection<HasMetadata> resourcesList) {
Expand Down

0 comments on commit cea2585

Please sign in to comment.