File tree Expand file tree Collapse file tree 3 files changed +14
-10
lines changed
extensions/kubernetes-client/deployment/src/main/java/io/quarkus/kubernetes/client/deployment
integration-tests/kubernetes-client-devservices/src/main/resources Expand file tree Collapse file tree 3 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -90,8 +90,7 @@ quarkus.kubernetes-client.devservices.manifests=kubernetes/namespace.yaml
9090
9191When applying multiple properties, you can apply them as:
9292```
93- quarkus.kubernetes-client.devservices.manifests[0]=kubernetes/first_manifest.yaml
94- quarkus.kubernetes-client.devservices.manifests[1]=kubernetes/second_manifest.yaml
93+ quarkus.kubernetes-client.devservices.manifests=kubernetes/first_manifest.yaml,kubernetes/second_manifest.yaml
9594```
9695
9796It is also possible to apply manifests from a URL. So the following syntax would also be possible:
Original file line number Diff line number Diff line change 1111import java .io .ByteArrayOutputStream ;
1212import java .io .IOException ;
1313import java .io .InputStream ;
14+ import java .net .MalformedURLException ;
1415import java .net .URL ;
1516import java .time .Duration ;
1617import java .util .*;
@@ -253,14 +254,19 @@ private boolean isReadinessApplicable(HasMetadata item) {
253254 }
254255
255256 private InputStream getManifestStream (String manifestPath ) throws IOException {
256- if (manifestPath .startsWith ("http://" ) || manifestPath .startsWith ("https://" )) {
257- // Option 1: The manifest is a URL, in which case we download it
258- return new URL (manifestPath ).openStream ();
259- } else {
260- // Option 2: The manifest is a file in the resources directory
261- return Thread .currentThread ()
257+ try {
258+ URL url = new URL (manifestPath );
259+ // For file:// URLs, optionally check if you want to support those or not
260+ return url .openStream ();
261+ } catch (MalformedURLException e ) {
262+ // Not a URL, so treat as classpath resource
263+ InputStream stream = Thread .currentThread ()
262264 .getContextClassLoader ()
263265 .getResourceAsStream (manifestPath );
266+ if (stream == null ) {
267+ throw new IOException ("Resource not found: " + manifestPath );
268+ }
269+ return stream ;
264270 }
265271 }
266272
Original file line number Diff line number Diff line change 1- quarkus.kubernetes-client.devservices.manifests[0]=kubernetes/namespace.yaml
2- quarkus.kubernetes-client.devservices.manifests[1]=https://k8s.io/examples/admin/namespace-dev.yaml
1+ quarkus.kubernetes-client.devservices.manifests =kubernetes/namespace.yaml,https://k8s.io/examples/admin/namespace-dev.yaml
You can’t perform that action at this time.
0 commit comments