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
2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 12
12
import java .util .HashMap ;
13
13
import java .util .List ;
14
14
import okhttp3 .mockwebserver .MockWebServer ;
15
+ import org .slf4j .Logger ;
16
+ import org .slf4j .LoggerFactory ;
15
17
import org .springframework .beans .factory .annotation .Value ;
16
18
import org .springframework .context .annotation .Bean ;
17
19
import org .springframework .context .annotation .Configuration ;
20
22
@ Configuration
21
23
public class TestConfiguration {
22
24
25
+ private static final Logger log = LoggerFactory .getLogger (TestConfiguration .class );
26
+
23
27
@ Value ("${io.javaoperatorsdk.test.crdPaths}" )
24
28
private List <String > crdPaths ;
25
29
@@ -37,8 +41,7 @@ public KubernetesMockServer k8sMockServer() {
37
41
}
38
42
39
43
@ Bean
40
- public KubernetesClient kubernetesClient (KubernetesMockServer server )
41
- throws FileNotFoundException {
44
+ public KubernetesClient kubernetesClient (KubernetesMockServer server ) {
42
45
final var client = server .createClient ();
43
46
44
47
crdPaths .forEach (
@@ -47,8 +50,9 @@ public KubernetesClient kubernetesClient(KubernetesMockServer server)
47
50
try {
48
51
crd =
49
52
Serialization .unmarshal (
50
- new FileInputStream (ResourceUtils .getFile ("classpath:test-crd.yaml" )));
53
+ new FileInputStream (ResourceUtils .getFile (crdPath )));
51
54
} catch (FileNotFoundException e ) {
55
+ log .warn ("CRD with path {} not found!" , crdPath );
52
56
e .printStackTrace ();
53
57
return ;
54
58
}
Original file line number Diff line number Diff line change @@ -5,4 +5,4 @@ io.javaoperatorsdk:
5
5
maxAttempts : 3
6
6
7
7
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