operator-lifecycle-manager icon indicating copy to clipboard operation
operator-lifecycle-manager copied to clipboard

Fix the version sub-command for the executables in this repository

Open timflannagan opened this issue 3 years ago • 2 comments

Description of the change: Remove the out-of-date OLM_VERSION static file that was previously used in the release process before goreleaser was integrated in this repository. Update the Makefile and Dockerfile to get this information through git and populating the version fields at runtime.

Motivation for the change: /cleanup

Sample output when run locally:

$ make build
go build -mod=vendor -ldflags "-X github.com/operator-framework/operator-lifecycle-manager/pkg/version.GitCommit=163bdb591986c53b46c327cc1fa9e6fd3a034206 -X github.com/operator-framework/operator-lifecycle-manager/pkg/version.OLMVersion=v0.19.1-100-g163bdb591" -tags "json1" -o bin/catalog github.com/operator-framework/operator-lifecycle-manager/cmd/catalog
go build -mod=vendor -ldflags "-X github.com/operator-framework/operator-lifecycle-manager/pkg/version.GitCommit=163bdb591986c53b46c327cc1fa9e6fd3a034206 -X github.com/operator-framework/operator-lifecycle-manager/pkg/version.OLMVersion=v0.19.1-100-g163bdb591" -tags "json1" -o bin/olm github.com/operator-framework/operator-lifecycle-manager/cmd/olm
go build -mod=vendor -ldflags "-X github.com/operator-framework/operator-lifecycle-manager/pkg/version.GitCommit=163bdb591986c53b46c327cc1fa9e6fd3a034206 -X github.com/operator-framework/operator-lifecycle-manager/pkg/version.OLMVersion=v0.19.1-100-g163bdb591" -tags "json1" -o bin/package-server github.com/operator-framework/operator-lifecycle-manager/cmd/package-server

$ ./bin/olm --version
OLM version: v0.19.1-100-g163bdb591
git commit: 163bdb591986c53b46c327cc1fa9e6fd3a034206
$ ./bin/catalog --version
OLM version: v0.19.1-100-g163bdb591
git commit: 163bdb591986c53b46c327cc1fa9e6fd3a034206

Reviewer Checklist

  • [ ] Implementation matches the proposed design, or proposal is updated to match implementation
  • [ ] Sufficient unit test coverage
  • [ ] Sufficient end-to-end test coverage
  • [ ] Docs updated or added to /doc
  • [ ] Commit messages sensible and descriptive
  • [ ] Tests marked as [FLAKE] are truly flaky
  • [ ] Tests that remove the [FLAKE] tag are no longer flaky

timflannagan avatar Feb 17 '22 19:02 timflannagan

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: timflannagan

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:

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 Feb 17 '22 19:02 openshift-ci[bot]

• Failure [115.244 seconds]
Operator API
/home/runner/work/operator-lifecycle-manager/operator-lifecycle-manager/test/e2e/operator_test.go:31
  when a subscription to a package exists
  /home/runner/work/operator-lifecycle-manager/operator-lifecycle-manager/test/e2e/operator_test.go:242
    should automatically adopt components [It]
    /home/runner/work/operator-lifecycle-manager/operator-lifecycle-manager/test/e2e/operator_test.go:336
...
    to satisfy
        <e2e.OperatorMatcher>: {
            matches: 0x2afab20,
            name: "ReferenceComponents([&ObjectReference{Kind:Subscription,Namespace:ns-rndz6,Name:sub-62rmk,UID:,APIVersion:operators.coreos.com/v1alpha1,ResourceVersion:,FieldPath:,} &ObjectReference{Kind:InstallPlan,Namespace:ns-rndz6,Name:install-dt5tf,UID:,APIVersion:operators.coreos.com/v1alpha1,ResourceVersion:,FieldPath:,} &ObjectReference{Kind:ClusterServiceVersion,Namespace:ns-rndz6,Name:kiali-operator.v1.4.2,UID:,APIVersion:operators.coreos.com/v1alpha1,ResourceVersion:,FieldPath:,} &ObjectReference{Kind:ServiceAccount,Namespace:ns-rndz6,Name:kiali-operator,UID:,APIVersion:v1,ResourceVersion:,FieldPath:,} &ObjectReference{Kind:CustomResourceDefinition,Namespace:,Name:kialis.kiali.io,UID:,APIVersion:apiextensions.k8s.io/v1,ResourceVersion:,FieldPath:,} &ObjectReference{Kind:CustomResourceDefinition,Namespace:,Name:monitoringdashboards.monitoring.kiali.io,UID:,APIVersion:apiextensions.k8s.io/v1,ResourceVersion:,FieldPath:,}])",
        }

This just popped up after merging the k8s 1.23 rebase. We ran into issues with this test before, so we should keep an eye out if e2e start failing consistently in the short term.

timflannagan avatar Feb 22 '22 19:02 timflannagan