File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
operator-framework-spring-boot-starter-test/src/main/java/io/javaoperatorsdk/operator/springboot/starter/test
samples/spring-boot-auto-config/src/test/resources Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 1212import java .util .HashMap ;
1313import java .util .List ;
1414import okhttp3 .mockwebserver .MockWebServer ;
15+ import org .slf4j .Logger ;
16+ import org .slf4j .LoggerFactory ;
1517import org .springframework .beans .factory .annotation .Value ;
1618import org .springframework .context .annotation .Bean ;
1719import org .springframework .context .annotation .Configuration ;
2022@ Configuration
2123public class TestConfiguration {
2224
25+ private static final Logger log = LoggerFactory .getLogger (TestConfiguration .class );
26+
2327 @ Value ("${io.javaoperatorsdk.test.crdPaths}" )
2428 private List <String > crdPaths ;
2529
@@ -37,8 +41,7 @@ public KubernetesMockServer k8sMockServer() {
3741 }
3842
3943 @ Bean
40- public KubernetesClient kubernetesClient (KubernetesMockServer server )
41- throws FileNotFoundException {
44+ public KubernetesClient kubernetesClient (KubernetesMockServer server ) {
4245 final var client = server .createClient ();
4346
4447 crdPaths .forEach (
@@ -47,8 +50,9 @@ public KubernetesClient kubernetesClient(KubernetesMockServer server)
4750 try {
4851 crd =
4952 Serialization .unmarshal (
50- new FileInputStream (ResourceUtils .getFile ("classpath:test-crd.yaml" )));
53+ new FileInputStream (ResourceUtils .getFile (crdPath )));
5154 } catch (FileNotFoundException e ) {
55+ log .warn ("CRD with path {} not found!" , crdPath );
5256 e .printStackTrace ();
5357 return ;
5458 }
Original file line number Diff line number Diff line change @@ -5,4 +5,4 @@ io.javaoperatorsdk:
55 maxAttempts : 3
66
77 test :
8- crdPaths : classpath:test-crd.yaml,bye.yaml
8+ crdPaths : classpath:test-crd.yaml
You can’t perform that action at this time.
0 commit comments