Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal/*: define ImageVersion, which is set to the most recent #4083

Merged

Conversation

estroz
Copy link
Member

@estroz estroz commented Oct 22, 2020

Description of the change:

  • internal/*: define ImageVersion, which is set to the most recent of operator-sdk repo tag or release commit's future tag. This variable is consumed by ansible-operator, helm-operator, and scorecard plugins
  • Makefile: set IMAGE_VERSION to v1.1.0, and set ImageVersion in ldflags

Motivation for the change: samples generated for a release commit will have incorrect versions, specifically the major+minor version preceding the soon-to-be-released version, in the current release setup because these versions depend on a release's git tag which has not been created yet. Setting this version explicitly in the Makefile breaks this cycle, allowing samples to be generated with a version that has not been released yet; these will still pass e2e tests because image tags are substituted anyway.

This PR makes no user-facing changes (except changing the operator-sdk version output string, which I would consider a bugfix and can add a fragment if desired).

Closes #4061

Checklist

If the pull request includes user-facing changes, extra documentation is required:

var (
Version = "unknown"
GitVersion = "unknown"
GitCommit = "unknown"
KubernetesVersion = "unknown"
GoVersion = fmt.Sprintf("%s %s/%s", runtime.Version(), runtime.GOOS, runtime.GOARCH)
Copy link
Member Author

Choose a reason for hiding this comment

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

GoVersion contains redundant information (GOOS and GOARCH are already printed by the version subcommand) so I removed it in favor of calling runtime.Version() directly.

@estroz
Copy link
Member Author

estroz commented Oct 22, 2020

/cc @joelanford @camilamacedo86

@estroz
Copy link
Member Author

estroz commented Oct 26, 2020

Relates to #4061

Copy link
Contributor

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

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

Hi @estroz,

Could you please rebase it with the master and push to re-trigger the tests?
It shows fine for me 👍 .

of operator-sdk repo tag or release commit's future tag. This variable
is consumed by ansible-operator, helm-operator, and scorecard plugins

Makefile: set IMAGE_VERSION to v1.1.0, and set ImageVersion in ldflags

internal/version: removed GoVersion in favor of using runtime.Version()
in dependent packages
@estroz estroz force-pushed the feature/external-image-version branch from df82397 to cc5d27e Compare October 31, 2020 02:41
@estroz estroz changed the title Makefile,internal/*: explicitly set version for ansible/helm/scorecard plugins internal/*: define ImageVersion, which is set to the most recent Oct 31, 2020
@estroz estroz merged commit 6df7af8 into operator-framework:master Oct 31, 2020
@estroz estroz deleted the feature/external-image-version branch October 31, 2020 19:06
reinvantveer pushed a commit to reinvantveer/operator-sdk that referenced this pull request Feb 5, 2021
…rator-framework#4083)

of operator-sdk repo tag or release commit's future tag. This variable
is consumed by ansible-operator, helm-operator, and scorecard plugins

Makefile: set IMAGE_VERSION to v1.1.0, and set ImageVersion in ldflags

internal/version: removed GoVersion in favor of using runtime.Version()
in dependent packages

Signed-off-by: reinvantveer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Samples generation cause problems during releases
2 participants