Skip to content

Conversation

@timflannagan
Copy link
Member

@timflannagan timflannagan commented Feb 17, 2022

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

@openshift-ci
Copy link

openshift-ci bot commented Feb 17, 2022

[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 openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 17, 2022
@timflannagan timflannagan force-pushed the fix-version-subcommand branch from 163bdb5 to 9601515 Compare February 17, 2022 19:27
release: ver=$(GIT_TAG)
release: manifests
@echo "Generating the $(ver) release"
docker pull $(IMAGE_REPO):$(ver)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an ordering issue here? Will this image exist without a tag in the remote repo? If we push a tag before we generate the release manifests, then they won't be present in the release.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be fine as we always override this ver variable during the release process, so the ordering problem shouldn't be an issue as we trigger the release process when a new git tag is created.

Side note: It felt like this target needs to be reworked but I didn't want to tackle any structuring changes in this PR.

@timflannagan
Copy link
Member Author

• 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 timflannagan force-pushed the fix-version-subcommand branch from be2a3cc to 06ba742 Compare February 23, 2022 01:10
@timflannagan timflannagan force-pushed the fix-version-subcommand branch from 06ba742 to 3049a2b Compare March 30, 2022 13:58
@timflannagan timflannagan force-pushed the fix-version-subcommand branch from 3049a2b to cdf60f4 Compare April 27, 2022 02:14
This file is now out-of-date as we no longer use this file to track OLM
release versioning.

Signed-off-by: timflannagan <timflannagan@gmail.com>
Update the build and release related Makefile targets to consume the
latest annotated git tag information.

Signed-off-by: timflannagan <timflannagan@gmail.com>
@timflannagan timflannagan force-pushed the fix-version-subcommand branch from cdf60f4 to d5860c1 Compare July 28, 2022 18:58
@timflannagan timflannagan deleted the fix-version-subcommand branch September 10, 2022 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants