Skip to content

Commit 1a3a046

Browse files
author
attila.meszaros
committed
- remove obsolete comment
1 parent 8be9d2f commit 1a3a046

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

operator-framework/src/main/java/com/github/containersolutions/operator/processing/EventDispatcher.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ public void handleEvent(CustomResourceEvent event) {
5757
updateCustomResourceWithFinalizer(resource);
5858
} else {
5959
UpdateControl<? extends CustomResource> updateControl = controller.createOrUpdateResource(resource, context);
60-
// note that we do the status sub-resource update first, since if there is an event from Custom resource
61-
// update as next step, the new status is already present.
6260
if (updateControl.isUpdateStatusSubResource()) {
6361
customResourceFacade.updateStatus(updateControl.getCustomResource());
6462
} else if (updateControl.isUpdateCustomResource()) {

operator-framework/src/test/java/com/github/containersolutions/operator/SubResourceUpdateIT.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import io.fabric8.kubernetes.api.model.ObjectMetaBuilder;
77
import io.fabric8.kubernetes.client.DefaultKubernetesClient;
88
import io.fabric8.kubernetes.client.KubernetesClient;
9+
import org.junit.jupiter.api.BeforeEach;
910
import org.junit.jupiter.api.Test;
1011
import org.junit.jupiter.api.TestInstance;
1112

@@ -22,6 +23,7 @@ public class SubResourceUpdateIT {
2223

2324
private IntegrationTestSupport integrationTestSupport = new IntegrationTestSupport();
2425

26+
@BeforeEach
2527
public void initAndCleanup() {
2628
KubernetesClient k8sClient = new DefaultKubernetesClient();
2729
integrationTestSupport.initialize(k8sClient, new SubResourceTestCustomResourceController(),
@@ -31,7 +33,6 @@ public void initAndCleanup() {
3133

3234
@Test
3335
public void updatesSubResourceStatus() {
34-
initAndCleanup();
3536
integrationTestSupport.teardownIfSuccess(() -> {
3637
SubResourceTestCustomResource resource = createTestCustomResource("1");
3738
integrationTestSupport.getCrOperations().inNamespace(TEST_NAMESPACE).create(resource);
@@ -49,7 +50,6 @@ public void updatesSubResourceStatus() {
4950
*/
5051
@Test
5152
public void ifNoFinalizerPresentFirstAddsTheFinalizerThenExecutesControllerAgain() {
52-
initAndCleanup();
5353
integrationTestSupport.teardownIfSuccess(() -> {
5454
SubResourceTestCustomResource resource = createTestCustomResource("1");
5555
resource.getMetadata().getFinalizers().clear();
@@ -71,7 +71,6 @@ public void ifNoFinalizerPresentFirstAddsTheFinalizerThenExecutesControllerAgain
7171
* */
7272
@Test
7373
public void updateCustomResourceAfterSubResourceChange() {
74-
initAndCleanup();
7574
integrationTestSupport.teardownIfSuccess(() -> {
7675
SubResourceTestCustomResource resource = createTestCustomResource("1");
7776
integrationTestSupport.getCrOperations().inNamespace(TEST_NAMESPACE).create(resource);

0 commit comments

Comments
 (0)