Skip to content
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

Remove not needed resource classes + correct readiness check #78

Closed
wants to merge 2 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
3 changes: 0 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,6 @@
<modules>
<module>test-frame-common</module>
<module>test-frame-kubernetes</module>
<module>test-frame-openshift</module>
<module>test-frame-test</module>
<module>test-frame-metrics-collector</module>
</modules>
Expand All @@ -304,7 +303,6 @@
<modules>
<module>test-frame-common</module>
<module>test-frame-kubernetes</module>
<module>test-frame-openshift</module>
<module>test-frame-metrics-collector</module>
</modules>
<properties>
Expand Down Expand Up @@ -366,7 +364,6 @@
<descriptors>
<descriptor>test-frame-common/src/main/assembly/dist.xml</descriptor>
<descriptor>test-frame-kubernetes/src/main/assembly/dist.xml</descriptor>
<descriptor>test-frame-openshift/src/main/assembly/dist.xml</descriptor>
<descriptor>test-frame-metrics-collector/src/main/assembly/dist.xml</descriptor>
</descriptors>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Consumer;

import io.fabric8.kubernetes.api.model.Endpoints;
import io.fabric8.kubernetes.api.model.HasMetadata;
import io.fabric8.kubernetes.api.model.Node;
import io.fabric8.kubernetes.api.model.Pod;
import io.fabric8.kubernetes.api.model.ReplicationController;
import io.fabric8.kubernetes.api.model.apps.Deployment;
import io.fabric8.kubernetes.api.model.apps.ReplicaSet;
import io.fabric8.kubernetes.api.model.apps.StatefulSet;
import io.skodjob.testframe.LoggerUtils;
import io.skodjob.testframe.TestFrameConstants;
import io.skodjob.testframe.TestFrameEnv;
Expand Down Expand Up @@ -244,11 +251,10 @@ private <T extends HasMetadata> void createOrUpdateResource(boolean waitReady,
}
if (waitReady) {
assertTrue(waitResourceCondition(resource, new ResourceCondition<>(p -> {
try {
if (isResourceWithReadiness(resource)) {
return client.getClient().resource(resource).isReady();
} catch (Exception ex) {
return client.getClient().resource(resource) != null;
}
return client.getClient().resource(resource) != null;
}, "ready")),
String.format("Timed out waiting for %s/%s in %s to be ready", resource.getKind(),
resource.getMetadata().getName(), resource.getMetadata().getNamespace()));
Expand Down Expand Up @@ -425,4 +431,15 @@ private <T extends HasMetadata> ResourceType<T> findResourceType(T resource) {
}
return null;
}

private <T extends HasMetadata> boolean isResourceWithReadiness(T resource) {
return resource instanceof Deployment
|| resource instanceof io.fabric8.kubernetes.api.model.extensions.Deployment
|| resource instanceof ReplicaSet
|| resource instanceof Pod
|| resource instanceof ReplicationController
|| resource instanceof Endpoints
|| resource instanceof Node
|| resource instanceof StatefulSet;
}
}

This file was deleted.

This file was deleted.

Loading
Loading