-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Attila Mészáros <[email protected]> format Signed-off-by: Attila Mészáros <[email protected]> docs Signed-off-by: Attila Mészáros <[email protected]> feat: support to handle different cluster for InformerEventSource Signed-off-by: Attila Mészáros <[email protected]>
- Loading branch information
Showing
7 changed files
with
125 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...eratorsdk/operator/baseapi/informerremotecluster/InformerRemoteClusterCustomResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package io.javaoperatorsdk.operator.baseapi.informerremotecluster; | ||
|
||
import io.fabric8.kubernetes.api.model.Namespaced; | ||
import io.fabric8.kubernetes.client.CustomResource; | ||
import io.fabric8.kubernetes.model.annotation.Group; | ||
import io.fabric8.kubernetes.model.annotation.ShortNames; | ||
import io.fabric8.kubernetes.model.annotation.Version; | ||
|
||
@Group("sample.javaoperatorsdk") | ||
@Version("v1") | ||
@ShortNames("irc") | ||
public class InformerRemoteClusterCustomResource | ||
extends CustomResource<Void, InformerRemoteClusterStatus> implements Namespaced { | ||
} |
23 changes: 23 additions & 0 deletions
23
...va/io/javaoperatorsdk/operator/baseapi/informerremotecluster/InformerRemoteClusterIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package io.javaoperatorsdk.operator.baseapi.informerremotecluster; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.javaoperatorsdk.jenvtest.junit.EnableKubeAPIServer; | ||
import io.javaoperatorsdk.operator.baseapi.labelselector.LabelSelectorTestReconciler; | ||
import io.javaoperatorsdk.operator.junit.LocallyRunOperatorExtension; | ||
|
||
@EnableKubeAPIServer(apiServerFlags = {"--min-request-timeout", "1"}) | ||
public class InformerRemoteClusterIT { | ||
|
||
@RegisterExtension | ||
LocallyRunOperatorExtension extension = | ||
LocallyRunOperatorExtension.builder().withReconciler(new LabelSelectorTestReconciler()) | ||
.build(); | ||
|
||
@Test | ||
void testRemoteClusterInformer() { | ||
|
||
} | ||
|
||
} |
32 changes: 32 additions & 0 deletions
32
...vaoperatorsdk/operator/baseapi/informerremotecluster/InformerRemoteClusterReconciler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package io.javaoperatorsdk.operator.baseapi.informerremotecluster; | ||
|
||
import java.util.List; | ||
|
||
import io.javaoperatorsdk.operator.api.reconciler.Context; | ||
import io.javaoperatorsdk.operator.api.reconciler.ControllerConfiguration; | ||
import io.javaoperatorsdk.operator.api.reconciler.EventSourceContext; | ||
import io.javaoperatorsdk.operator.api.reconciler.Reconciler; | ||
import io.javaoperatorsdk.operator.api.reconciler.UpdateControl; | ||
import io.javaoperatorsdk.operator.processing.event.source.EventSource; | ||
|
||
@ControllerConfiguration | ||
public class InformerRemoteClusterReconciler | ||
implements Reconciler<InformerRemoteClusterCustomResource> { | ||
|
||
|
||
@Override | ||
public UpdateControl<InformerRemoteClusterCustomResource> reconcile( | ||
InformerRemoteClusterCustomResource resource, | ||
Context<InformerRemoteClusterCustomResource> context) throws Exception { | ||
|
||
|
||
|
||
return UpdateControl.noUpdate(); | ||
} | ||
|
||
@Override | ||
public List<EventSource<?, InformerRemoteClusterCustomResource>> prepareEventSources( | ||
EventSourceContext<InformerRemoteClusterCustomResource> context) { | ||
return Reconciler.super.prepareEventSources(context); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...o/javaoperatorsdk/operator/baseapi/informerremotecluster/InformerRemoteClusterStatus.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package io.javaoperatorsdk.operator.baseapi.informerremotecluster; | ||
|
||
public class InformerRemoteClusterStatus { | ||
|
||
|
||
|
||
} |