[release-4.20] OCPBUGS-113989: frr-k8s: use Recreate strategy for webhook server deployment on SNO - #3142
Conversation
This commit adds helper functions to testutil_test.go that are used by component rendering tests to verify rendered Kubernetes objects: - mustFindRenderedObj: Finds and converts unstructured objects using generics - mustFindContainer: Finds a container by name in a container list - findExecCommand: Extracts exec command strings from container command args These utilities facilitate testing of rendered manifests and container configurations across multiple components. Signed-off-by: Tom Pantelis <tompantelis@gmail.com> Co-Authored-By: Ori Braunshtein <obraunsh@redhat.com> (cherry picked from commit c617131) Cherry-pick not clean: - dropped definiton of mustFindContainer and findExecCommand (otherwise lint fails) (cherry picked from commit cedf0d7) (cherry picked from commit 3730249) Signed-off-by: Andreas Karis <ak.karis@gmail.com>
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
|
@andreaskaris: This pull request references Jira Issue OCPBUGS-113989, which is valid. The bug has been moved to the POST state. 7 validation(s) were run on this bug
No GitHub users were found matching the public email listed for the QA contact in Jira (jechen@redhat.com), skipping review request. The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
@andreaskaris: This pull request references Jira Issue OCPBUGS-113989, which is valid. 7 validation(s) were run on this bug
No GitHub users were found matching the public email listed for the QA contact in Jira (jechen@redhat.com), skipping review request. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
The statuscleaner deployment uses hostNetwork with a fixed port (9123). With the default RollingUpdate strategy, upgrades on SNO clusters get stuck because the new pod cannot bind the host port already held by the old pod. Switching to Recreate ensures the old pod is terminated before the new one starts. Signed-off-by: Federico Paolinelli <fpaoline@redhat.com> Co-Authored-By: Ori Braunshtein <obraunsh@redhat.com> Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> (cherry picked from commit 3d86b75) Cherry-pick not clean: - added bootstrap result wiring to additionalRoutingCapibilities (that was already there for 5.0), aligned existing unit test with fakeBootstrapResult() as in 5.0 (cherry picked from commit a5752d9) Conflicts: pkg/network/render.go preserving Very small conflict due to the presence of isSupportedDualStackPlatform. Resolution: keep isSupportedDualStackPlatform + add bootstrapResult to renderAdditionalRoutingCapabilities. (cherry picked from commit 9d495a4) Conflicts: On release-4.20 the hostNetwork deployment is frr-k8s-webhook-server, not frr-k8s-statuscleaner (which was split out in 4.21). Update the strategy unit test to target the correct deployment name and make the template change in webhook.yaml. Co-Authored-By: Jean Chen <jechen@redhat.com> Signed-off-by: Andreas Karis <ak.karis@gmail.com>
On upgrade, the frr-k8s-statuscleaner Deployment has rollingUpdate
fields defaulted by the API server. SSA cannot remove fields it does
not own, so switching strategy.type to Recreate fails with:
spec.strategy.rollingUpdate: Forbidden: may not be specified when
strategy `type` is 'Recreate'
Add a generic pre-patch annotation:
networkoperator.openshift.io/pre-patch
that applies a strategic-merge-patch to the live object before SSA. This
lets the template atomically set type=Recreate and remove rollingUpdate
in a single patch, before SSA takes over.
Also explicitly set strategy to RollingUpdate with rollingUpdate fields
on non-SNO clusters so that CNO owns these fields going forward,
preventing the issue from recurring in case we have to make the same
switch for non-SNO clusters in the future.
Signed-off-by: Andreas Karis <ak.karis@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
(cherry picked from commit 8ebb78e)
(cherry picked from commit d59aba6)
(cherry picked from commit 4342f64)
Conflicts:
File node-status-cleaner.yaml does not exist, instead make the changes
in webhook.yaml
Signed-off-by: Andreas Karis <ak.karis@gmail.com>
6dbb1d7 to
ee9b308
Compare
Add tests for ApplyObject's pre-patch behavior: strategic-merge-patch runs before SSA, NotFound is tolerated, other errors stop reconciliation, and objects without the annotation skip pre-patch entirely. Remove fakeRESTMapper and replace it with testrestmapper.TetsOnlyStaticRESTMapper to return a proper mapper, and return scheme.Scheme from Scheme(). Both changes needed by ApplyObject under test. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Andreas Karis <ak.karis@gmail.com> (cherry picked from commit 6ca59b1) (cherry picked from commit b1775c9) Not clean cherry-pick: Make the linter happy by applying the changes to pkg/apply from openshift#3138. See that PR for further details. (cherry picked from commit 216d5c2) Issues / manual changes: controller-runtime v0.21.0 does not have addToSchemeIfUnknownAndUnstructuredOrPartial, so GVK test/test/test is not added automatically and TestStatusManager_set would fail. Instead, add a new scheme to the FakeClusterClient and register the GVK there for backwards compatibility. Signed-off-by: Andreas Karis <ak.karis@gmail.com>
ee9b308 to
5baae22
Compare
|
/pipeline required |
|
Scheduling required tests: Scheduling tests matching the |
|
/retest |
|
/verified by pre-merge testing by @jechen0648 |
|
@jechen0648: This PR has been marked as verified by DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/retest |
|
/lgtm |
|
Tests from second stage were triggered manually. Pipeline can be controlled only manually, until HEAD changes. Use command to trigger second stage. |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andreaskaris, fedepaol, jcaamano The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest |
2 similar comments
|
/retest |
|
/retest |
|
@andreaskaris: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
907dc8b
into
openshift:release-4.20
|
@andreaskaris: Jira Issue Verification Checks: Jira Issue OCPBUGS-113989 Jira Issue OCPBUGS-113989 has been moved to the MODIFIED state and will move to the VERIFIED state when the change is available in an accepted nightly payload. 🕓 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
Manual backport of github.com//pull/3135 to release 4.20.
A few issues during the backport process.
a) The template changes in newer versions are applied to node-status-cleaner.yaml, here they must be made to webhook.yaml
b) In 4.21 and beyond, the GVK is registered automatically, and thus test TestStatusManager_set passes even though it does not explicitly register the test/test/test GVK. In 4.20, this automatic registration does not happen, so we must explicitly register that GVK in the FakeClusterClient's scheme to make that test pass.
From Claude:
And here are the changes to the vendor directory where addToSchemeIfUnknownAndUnstructuredOrPartial is added (4.21 and beyond):
In 4.20, that's missing:
Meaning that's due to the change in controller-runtime: