File tree Expand file tree Collapse file tree 4 files changed +41
-0
lines changed
operator-annotations/src/main/resources/META-INF/services
src/test/java/io/javaoperatorsdk/operator Expand file tree Collapse file tree 4 files changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ io.javaoperatorsdk.processor.SampleProcessor
Original file line number Diff line number Diff line change 8484 <artifactId >kube-api-test-client-inject</artifactId >
8585 <scope >test</scope >
8686 </dependency >
87+ <dependency >
88+ <groupId >io.javaoperatorsdk</groupId >
89+ <artifactId >operator-annotations</artifactId >
90+ <version >5.1.3-SNAPSHOT</version >
91+ <scope >test</scope >
92+ </dependency >
8793 </dependencies >
8894
8995 <build >
106112 </compilerArgs >
107113 </configuration >
108114 </execution >
115+ <!-- During test compilation we need to enable the annotation processors -->
116+ <execution >
117+ <id >default-testCompile</id >
118+ <goals >
119+ <goal >testCompile</goal >
120+ </goals >
121+ <phase >test-compile</phase >
122+ <configuration >
123+ <annotationProcessorPaths >
124+ <path >
125+ <groupId >io.javaoperatorsdk</groupId >
126+ <artifactId >operator-annotations</artifactId >
127+ <version >${project.version} </version >
128+ </path >
129+ </annotationProcessorPaths >
130+ <compilerArgs >
131+ <arg >-proc:full</arg >
132+ </compilerArgs >
133+ </configuration >
134+ </execution >
109135 </executions >
110136 </plugin >
111137 <plugin >
Original file line number Diff line number Diff line change 1212import io .fabric8 .kubernetes .model .annotation .Group ;
1313import io .fabric8 .kubernetes .model .annotation .Kind ;
1414import io .fabric8 .kubernetes .model .annotation .Version ;
15+ import io .javaoperatorsdk .annotation .Sample ;
1516import io .javaoperatorsdk .operator .api .reconciler .Context ;
1617import io .javaoperatorsdk .operator .api .reconciler .ControllerConfiguration ;
1718import io .javaoperatorsdk .operator .api .reconciler .Reconciler ;
2122import static org .assertj .core .api .Assertions .assertThat ;
2223import static org .awaitility .Awaitility .await ;
2324
25+ @ Sample (
26+ tldr = "Shows how to use the test extension to load CRDs from files." ,
27+ description =
28+ "Shows how to use the test extension to load CRDs from files. This is useful when you want"
29+ + " to test your operator with real CRDs, for example when you want to test validation"
30+ + " or defaulting." )
2431public class CRDMappingInTestExtensionIT {
2532 private final KubernetesClient client = new KubernetesClientBuilder ().build ();
2633
Original file line number Diff line number Diff line change 1414import io .fabric8 .kubernetes .api .model .NamespaceBuilder ;
1515import io .fabric8 .kubernetes .api .model .ObjectMetaBuilder ;
1616import io .fabric8 .kubernetes .client .KubernetesClient ;
17+ import io .javaoperatorsdk .annotation .Sample ;
1718import io .javaoperatorsdk .operator .RegisteredController ;
1819import io .javaoperatorsdk .operator .api .reconciler .Constants ;
1920import io .javaoperatorsdk .operator .junit .LocallyRunOperatorExtension ;
2021
2122import static org .assertj .core .api .Assertions .assertThat ;
2223import static org .awaitility .Awaitility .await ;
2324
25+ @ Sample (
26+ tldr = "Changing the namespaces being watched at runtime" ,
27+ description =
28+ "Demonstrates how to change the namespaces being watched by a controller at runtime,"
29+ + " including adding and removing namespaces as well as switching to watch all"
30+ + " namespaces." )
2431class ChangeNamespaceIT {
2532
2633 public static final String TEST_RESOURCE_NAME_1 = "test1" ;
You can’t perform that action at this time.
0 commit comments