Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't fail reconciliation when Manual Rolling Update fails #10005

Merged
merged 10 commits into from
May 5, 2024

Conversation

Staniel
Copy link
Contributor

@Staniel Staniel commented Apr 19, 2024

Type of change

Select the type of your PR

  • Enhancement / new feature

Description

Implements https://github.com/strimzi/proposals/blob/main/070-dont-fail-reconciliation-in-manual-rolling-update.md

Checklist

Please go through this checklist and make sure all applicable tasks have been done

  • Write tests
  • Make sure all tests pass
  • Update documentation
  • Check RBAC rights for Kubernetes / OpenShift roles
  • Try your changes from Pod inside your Kubernetes and OpenShift cluster, not just locally
  • Reference relevant issue(s) and close them after merging
  • Update CHANGELOG.md
  • Supply screenshots for visual changes, such as Grafana dashboards

Lixin Yao added 4 commits April 19, 2024 14:14
Signed-off-by: Lixin Yao <lixin_yao@apple.com>
Signed-off-by: Lixin Yao <lixin_yao@apple.com>
Signed-off-by: Lixin Yao <lixin_yao@apple.com>
Signed-off-by: Lixin Yao <lixin_yao@apple.com>
@Staniel Staniel requested a review from scholzj April 19, 2024 21:16
Signed-off-by: Lixin Yao <lixin_yao@apple.com>
@scholzj scholzj added this to the 0.41.0 milestone Apr 19, 2024
@scholzj scholzj requested a review from ppatierno April 19, 2024 23:57
@scholzj
Copy link
Member

scholzj commented Apr 19, 2024

/azp run regression

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@scholzj scholzj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. The code looks good. I left only some smaller comments. Would it be worth to also add some unit tests for Connect / Mirror Maker 2? They have already some maunal rolling update tests in KafkaMirrorMaker2AssemblyOperatorPodSetTest.java and KafkaConnectAssemblyOperatorPodSetTest.java

@scholzj
Copy link
Member

scholzj commented Apr 20, 2024

One more thing ... could you also enable the feature gate in these two files:

in the strimzi_feature_gates parameter => that would allow us to run the tests with the feature gate enabled and see f that works as well. Thanks.

Lixin Yao added 2 commits April 20, 2024 10:20
Signed-off-by: Lixin Yao <lixin_yao@apple.com>
Signed-off-by: Lixin Yao <lixin_yao@apple.com>
@Staniel
Copy link
Contributor Author

Staniel commented Apr 20, 2024

Thanks for the PR. The code looks good. I left only some smaller comments. Would it be worth to also add some unit tests for Connect / Mirror Maker 2? They have already some maunal rolling update tests in KafkaMirrorMaker2AssemblyOperatorPodSetTest.java and KafkaConnectAssemblyOperatorPodSetTest.java

I looked at it but didn't find an easy way to simulate a manual roll failure, since it was not using mock operator. Any suggestion?

Signed-off-by: Lixin Yao <lixin_yao@apple.com>
@scholzj
Copy link
Member

scholzj commented Apr 21, 2024

I looked at it but didn't find an easy way to simulate a manual roll failure, since it was not using mock operator. Any suggestion?

Maybe you have to write one. You could also try to trigger the error through some mocked method. Maybe if you throw here an error instead of success it would cause an error you can use?

when(mockPodOps.deleteAsync(any(), eq(NAMESPACE), startsWith(COMPONENT_NAME), eq(false))).thenReturn(Future.succeededFuture());

Let's look sta it next week. Otherwise it looks good.

@scholzj
Copy link
Member

scholzj commented Apr 21, 2024

/azp run feature-gates-regression

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@scholzj
Copy link
Member

scholzj commented Apr 21, 2024

/azp run regression

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@katheris katheris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just had one comment about the tests.

@@ -429,6 +430,157 @@ vertx, new PlatformFeaturesAvailability(false, KUBERNETES_VERSION),
})));
}

@Test
public void testManualPodRollingUpdateWithPodSetsWithError1(VertxTestContext context) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are effectively parametrized tests, so it might be worth using the actual annotation, it would save having lots of tests with the same name but different numbers at the end. https://junit.org/junit5/docs/current/user-guide/#writing-tests-parameterized-tests-sources-MethodSource

Signed-off-by: Jakub Scholz <www@scholzj.com>
@scholzj
Copy link
Member

scholzj commented May 4, 2024

@Staniel I added the unit tests so that we can move forward with this and unblock some other work that would conflict with this.

@ppatierno Could you please review this?

@scholzj
Copy link
Member

scholzj commented May 5, 2024

/azp run regression

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@scholzj
Copy link
Member

scholzj commented May 5, 2024

/azp run feature-gates-regression

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@ppatierno ppatierno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@scholzj scholzj merged commit 79a155e into strimzi:main May 5, 2024
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants