ComplianceAsCode / compliance-operator

Operator providing Kubernetes cluster compliance checks
Apache License 2.0
36 stars 22 forks source link

Use git describe for finding operator version #500

Closed rhmdnd closed 2 months ago

rhmdnd commented 4 months ago

We need to be able to set the replaces attribute of the CSV file so that OLM can build a relationship between dependencies, which is important for disconnected installations and upgrades.

Previously, we were using the version in the CSV file, which worked but it would change within the make prepare-release target depending on when the command was invoked.

This commit updates the version script to use git describe instead, which makes finding the current version more robust since tagging isn't done until a subsequent step of the release process.

BhargaviGudi commented 4 months ago

/hold for test

BhargaviGudi commented 4 months ago

Verification passed with 4.16.0-0.nightly-2024-04-01-213440 + compliance-operator from pr #500 code

$ oc get csv
NAME                         DISPLAY               VERSION   REPLACES   PHASE
compliance-operator.v1.4.0   Compliance Operator   1.4.0                Succeeded
$ git describe --tags --abbrev=0 | tr -d v
1.4.0
BhargaviGudi commented 4 months ago

/unhold

BhargaviGudi commented 4 months ago

/label qe-aprroved

openshift-ci[bot] commented 4 months ago

@BhargaviGudi: The label(s) /label qe-aprroved cannot be applied. These labels are supported: acknowledge-critical-fixes-only, platform/aws, platform/azure, platform/baremetal, platform/google, platform/libvirt, platform/openstack, ga, tide/merge-method-merge, tide/merge-method-rebase, tide/merge-method-squash, px-approved, docs-approved, qe-approved, no-qe, downstream-change-needed, rebase/manual, cluster-config-api-changed, approved, backport-risk-assessed, bugzilla/valid-bug, cherry-pick-approved, jira/valid-bug, staff-eng-approved. Is this label configured under labels -> additional_labels or labels -> restricted_labels in plugin.yaml?

In response to [this](https://github.com/ComplianceAsCode/compliance-operator/pull/500#issuecomment-2031289745): >/label qe-aprroved 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.
openshift-ci[bot] commented 2 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rhmdnd, yuumasato

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/ComplianceAsCode/compliance-operator/blob/master/OWNERS)~~ [rhmdnd] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
yuumasato commented 2 months ago

/retest-required