node-maintenance-operator icon indicating copy to clipboard operation
node-maintenance-operator copied to clipboard

Add 3 labels to all resources, add e2e test that validate the existence of the three labels

Open Shai1-Levi opened this issue 10 months ago • 18 comments

Why we need this PR

To meet k8s custom labels standardization: Add 3 custom labels to all resources, add e2e that test the existence of name label

Changes made

  1. Add recommended app.kubernetes.io/name label to everything

With these changes we prevent services selecting pods by other operators, because they all have the control-plane: controller-manager label by default.

Because deployment updates with modified labels fail, also rename the deployment by modifying the namePrefix (causes bundle file renames as well).

  1. Add test that validate retrieval of operator controller pod by the name label.

  2. Add the default container label, for easier getting desired logs.

Which issue(s) this PR fixes

Test plan

Shai1-Levi avatar Jan 13 '25 16:01 Shai1-Levi

Hi @Shai1-Levi. Thanks for your PR.

I'm waiting for a medik8s member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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 kubernetes-sigs/prow repository.

openshift-ci[bot] avatar Jan 13 '25 16:01 openshift-ci[bot]

in the past at least, label additions broke updates... [1] IIRC e2e has an update test, let's see what happens.

/test 4.17-openshift-e2e

[1] https://github.com/medik8s/node-healthcheck-operator/commit/df1d2e8f1463fc94a77d11cb99c99ee8014d5006#diff-c006b1ef995eeeb57408cce42bd84db8dfc0cbe18df03222857665cebb1ac6fdR9-R18

slintes avatar Jan 14 '25 08:01 slintes

update still fails 🤷🏼‍♂️

"Failed to run bundle upgrade: error waiting for CSV to install: csv failed: reason: \"InstallComponentFailed\", message: \"install strategy failed: Deployment.apps \\\"node-maintenance-operator-controller-manager\\\" is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{\\\"app.kubernetes.io/name\\\":\\\"node-maintenance-operator\\\", \\\"control-plane\\\":\\\"controller-manager\\\", \\\"node-maintenance-operator\\\":\\\"\\\"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: field is immutable\"\n" make: *** [Makefile:208: bundle-run-update] Error 1

slintes avatar Jan 14 '25 12:01 slintes

/test 4.17-openshift-e2e

Shai1-Levi avatar Jan 15 '25 16:01 Shai1-Levi

@Shai1-Levi: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test 4.17-openshift-e2e

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 kubernetes-sigs/prow repository.

openshift-ci[bot] avatar Jan 15 '25 16:01 openshift-ci[bot]

/ok-to-test

razo7 avatar Jan 15 '25 16:01 razo7

/test 4.17-openshift-e2e

slintes avatar Jan 16 '25 09:01 slintes

operator update succeeded test failure looks unrelated, looking at the test history this seems to be very flaky... :/

/ok-to-test /lgtm /approve

slintes avatar Jan 16 '25 13:01 slintes

Hey, I added some labels to fix the e2e test and test-scorecard @slintes I didn't saw your last comment before I pushed the code

/test 4.17-openshift-e2e

Shai1-Levi avatar Jan 16 '25 18:01 Shai1-Levi

/retest /lgtm

slintes avatar Jan 17 '25 14:01 slintes

/retest

slintes avatar Jan 17 '25 16:01 slintes

setup failed...

/retest

slintes avatar Jan 18 '25 08:01 slintes

@razo7 since when is the e2e test so flaky? :/

Error waiting for events: context deadline exceeded  [FAILED] Event SucceedMaintenance was missing for test-maintenance nm CR
  Unexpected error:
      <context.deadlineExceededError>: 
      context deadline exceeded
      {}
  occurred

slintes avatar Jan 18 '25 12:01 slintes

/retest

slintes avatar Jan 18 '25 12:01 slintes

/hold

since this is not urgent, let's first try to fix the e2e test, these retests are a waste of resources...

slintes avatar Jan 22 '25 10:01 slintes

New changes are detected. LGTM label has been removed.

openshift-ci[bot] avatar Jan 22 '25 13:01 openshift-ci[bot]

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Shai1-Levi Once this PR has been reviewed and has the lgtm label, please ask for approval from slintes. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

openshift-ci[bot] avatar Jan 22 '25 17:01 openshift-ci[bot]

@Shai1-Levi: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/4.16-openshift-e2e 807c5f9c8f393d3b1d9921e77a6edd6b2c813a88 link true /test 4.16-openshift-e2e
ci/prow/4.17-openshift-e2e 807c5f9c8f393d3b1d9921e77a6edd6b2c813a88 link true /test 4.17-openshift-e2e
ci/prow/4.18-openshift-e2e 807c5f9c8f393d3b1d9921e77a6edd6b2c813a88 link true /test 4.18-openshift-e2e
ci/prow/4.20-ci-bundle-my-bundle 1827784a0b3cd1c99b9c449d68a2176ea93a6cda link true /test 4.20-ci-bundle-my-bundle

Full PR test history. Your PR dashboard.

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

openshift-ci[bot] avatar Jul 07 '25 08:07 openshift-ci[bot]