Skip to content

Commit 5f1e537

Browse files
authored
More flexible in cluster curl (#1034)
1 parent be327a7 commit 5f1e537

File tree

1 file changed

+5
-1
lines changed
  • operator-framework-junit5/src/main/java/io/javaoperatorsdk/operator/junit

1 file changed

+5
-1
lines changed

operator-framework-junit5/src/main/java/io/javaoperatorsdk/operator/junit/InClusterCurl.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,15 @@ public InClusterCurl(KubernetesClient client, String namespace) {
2121
}
2222

2323
public String checkUrl(String url) {
24+
return checkUrl("-s", "-o", "/dev/null", "-w", "%{http_code}", url);
25+
}
26+
27+
public String checkUrl(String... args) {
2428
String podName = KubernetesResourceUtil.sanitizeName("curl-" + UUID.randomUUID());
2529
try {
2630
Pod curlPod = client.run().inNamespace(namespace)
2731
.withRunConfig(new RunConfigBuilder()
28-
.withArgs("-s", "-o", "/dev/null", "-w", "%{http_code}", url)
32+
.withArgs(args)
2933
.withName(podName)
3034
.withImage("curlimages/curl:7.78.0")
3135
.withRestartPolicy("Never")

0 commit comments

Comments
 (0)