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
90
90
91
91
When applying multiple properties, you can apply them as:
92
92
```
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
95
94
```
96
95
97
96
It 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 11
11
import java .io .ByteArrayOutputStream ;
12
12
import java .io .IOException ;
13
13
import java .io .InputStream ;
14
+ import java .net .MalformedURLException ;
14
15
import java .net .URL ;
15
16
import java .time .Duration ;
16
17
import java .util .*;
@@ -253,14 +254,19 @@ private boolean isReadinessApplicable(HasMetadata item) {
253
254
}
254
255
255
256
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 ()
262
264
.getContextClassLoader ()
263
265
.getResourceAsStream (manifestPath );
266
+ if (stream == null ) {
267
+ throw new IOException ("Resource not found: " + manifestPath );
268
+ }
269
+ return stream ;
264
270
}
265
271
}
266
272
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