Skip to content

Commit

Permalink
TEMPtest2
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiobrz committed Dec 22, 2024
1 parent 7dae82b commit 616d22c
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ jobs:
with:
oc version: 'v3.10.0'
github token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup OLM on OpenShift v3.z
if: ${{ matrix.target == 'openshift' }}
run: |
set -x
oc get routes -A
# - name: Setup OLM on OpenShift v3.z
# if: ${{ matrix.target == 'openshift' }}
# run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

import io.fabric8.openshift.api.model.Route;
import io.fabric8.openshift.client.OpenShiftClient;
import org.arquillian.cube.openshift.api.OpenShiftResource;
import org.arquillian.cube.openshift.impl.enricher.AwaitRoute;
import org.arquillian.cube.openshift.impl.enricher.RouteURL;
import org.arquillian.cube.openshift.impl.requirement.RequiresOpenshift;
import org.arquillian.cube.requirement.ArquillianConditionalRunner;
Expand All @@ -22,16 +24,19 @@
@Category(RequiresOpenshift.class)
@RequiresOpenshift
@RunWith(ArquillianConditionalRunner.class)
@OpenShiftResource("classpath:hello-world-route.yaml")
public class RouteInOtherNamespaceIT {

@RouteURL(value = "prometheus-k8s", namespace = "openshift-monitoring")
@RouteURL(value = "hello-world", namespace = "default")
@AwaitRoute
private URL routeURL;

@ArquillianResource
OpenShiftClient client;

@Before
public void enumerateRoutes() {
System.out.println("---> DEBUG: Enumerating routes in all namespaces");
client.namespaces().list().getItems().stream().forEach(n ->
{
final String namespace = n.getMetadata().getName();
Expand All @@ -53,7 +58,8 @@ public void injectedIntoClassShouldNotBeNull() {

@Test
public void injectedIntoMethodShouldNotBeNull(
@RouteURL(value = "prometheus-k8s", namespace = "openshift-monitoring") URL routeURL) {
@RouteURL(value = "hello-world", namespace = "default")
@AwaitRoute URL routeURL) {
assertThat(routeURL).isNotNull();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">

<extension qualifier="openshift">
<property name="env.config.resource.name">hello-openshift.json</property>
</extension>

</arquillian>
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"apiVersion" : "v1",
"kind" : "List",
"items" : [ {
"apiVersion" : "v1",
"kind" : "Service",
"metadata" : {
"name" : "hello-world",
"namespace" : "default"
},
"spec" : {
"ports" : [ {
"port" : 8080,
"protocol" : "TCP",
"targetPort" : 8080
} ],
"selector" : {
"app" : "hello-world"
}
}
}, {
"apiVersion" : "apps/v1",
"kind" : "Deployment",
"metadata" : {
"name" : "hello-world",
"namespace" : "default"
},
"spec" : {
"replicas" : 1,
"selector" : {
"matchLabels": {
"app": "hello-world"
}
},
"template" : {
"metadata" : {
"labels" : {
"app" : "hello-world"
}
},
"spec" : {
"containers" : [ {
"image" : "quay.io/openshift/origin-hello-openshift:latest",
"imagePullPolicy": "IfNotPresent",
"name" : "hello-world-container",
"ports" : [ {
"name" : "http",
"protocol" : "TCP",
"containerPort" : 8080
} ],
"readinessProbe": {
"httpGet": {
"path": "/",
"port": 8080
},
"initialDelaySeconds": 1
}
} ]
}
}
}
}]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: Route
metadata:
name: hello-world
namespace: default
spec:
port:
targetPort: 8080
to:
kind: Service
name: hello-world

0 comments on commit 616d22c

Please sign in to comment.