medik8s / node-maintenance-operator

Kubernetes Operator to manage node maintenance through NodeMaintenance custom resources
https://www.medik8s.io/maintenance-node/
Apache License 2.0
27 stars 13 forks source link

Get version from image - must-gather #50

Closed razo7 closed 1 year ago

razo7 commented 2 years ago

According to the must-gather enhancement, there is a version file that indicates the product (first line) and the version (second line).

Currently the printed version is only in y.z format, due to regular expression, when y and z are one digit each. Resulting in "1.0" version for registry.redhat.io/workload-availability/node-maintenance-must-gather-rhel8:v4.11.0, rather than "4.11.0".

Fix bug https://issues.redhat.com/browse/ECOPROJECT-983

openshift-ci[bot] commented 2 years ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: razo7

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

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/medik8s/node-maintenance-operator/blob/main/OWNERS)~~ [razo7] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
razo7 commented 2 years ago

HOLD. Wait for a response after we have opened a discussion in ECOPROJECT-983 about possible bug in default OCP must-gather https://coreos.slack.com/archives/CFDM5CQMN/p1661184777988329

Maybe https://github.com/openshift/must-gather/pull/327 would resolve https://issues.redhat.com/browse/ECOPROJECT-982 without the need for this PR.

razo7 commented 1 year ago

Even though https://github.com/openshift/must-gather/pull/327 hasn't been merged, we follow their intuition of using embedded variable, OS_GIT_VERSION. Testing NMO's must gather upstream with this variable doesn't show the image version in a major.minor.micro-patch_version pattern, maybe it only works in downstream the build. But if it will be missing, then we use sed to fetch the image version from the pod ( in a major.minor.micro pattern).

openshift-ci[bot] commented 1 year ago

@razo7: The following test 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.12-openshift-e2e-ocp-4-12 2a6343a0c133caf39368b249e420e01656166ca8 link true /test 4.12-openshift-e2e-ocp-4-12

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
mshitrit commented 1 year ago

/lgtm

razo7 commented 1 year ago

I suspect that this is a PSA issue with OLM similar to NHC's PR, ans since the image is not aimed to v4.13 we can override the test.

/override ci/prow/4.13-openshift-e2e

openshift-ci[bot] commented 1 year ago

@razo7: Overrode contexts on behalf of razo7: ci/prow/4.13-openshift-e2e

In response to [this](https://github.com/medik8s/node-maintenance-operator/pull/50#issuecomment-1366560540): >I suspect that this is a PSA issue with OLM similar to [NHC's PR](https://github.com/medik8s/node-healthcheck-operator/pull/155#issuecomment-1361293111), ans since the image is not aimed to v4.13 we can override the test. > >/override ci/prow/4.13-openshift-e2e Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
razo7 commented 1 year ago

At last we have decided to not use the embedded variable, OS_GIT_VERSION, and we will use sed to fetch the image version and imageId.