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

Change version display for Serving and Eventing to 1.x scheme #1542

Closed
rhuss opened this issue Dec 9, 2021 · 2 comments · Fixed by #1601
Closed

Change version display for Serving and Eventing to 1.x scheme #1542

rhuss opened this issue Dec 9, 2021 · 2 comments · Fixed by #1601
Labels
backport/candidate Consider this PR to be backported to the release branch kind/bug Categorizes issue or PR as related to a bug. triage/accepted Issues which should be fixed (post-triage)
Milestone

Comments

@rhuss
Copy link
Contributor

rhuss commented Dec 9, 2021

With kn version for 1.0 we still get the 'technical' version of the serving and eventing dependency like in:

Version:      v1.0.0
Build Date:   2021-11-02 19:27:09
Git Revision: a1cf5bf8
Supported APIs:
* Serving
  - serving.knative.dev/v1 (knative-serving v0.27.0)
* Eventing
  - sources.knative.dev/v1 (knative-eventing v0.27.0)
  - eventing.knative.dev/v1 (knative-eventing v0.27.0)

We detected this late in the release process and was discussed at https://knative.slack.com/archives/C02HLGQALCE/p1635874127113600 so we should change this to

Version:      v1.1.0
Build Date:   2021-11-02 19:27:09
Git Revision: a1cf5bf8
Supported APIs:
* Serving
  - serving.knative.dev/v1 (knative-serving v1.1.0)
* Eventing
  - sources.knative.dev/v1 (knative-eventing v1.1.0)
  - eventing.knative.dev/v1 (knative-eventing v1.1.0)

to avoid confusions.

@rhuss rhuss added the kind/bug Categorizes issue or PR as related to a bug. label Dec 9, 2021
@rhuss rhuss added the triage/accepted Issues which should be fixed (post-triage) label Jan 3, 2022
@rhuss
Copy link
Contributor Author

rhuss commented Jan 3, 2022

This can be implemented by adapting the code in

version_serving=$(grep "knative.dev/serving " "${base}/go.mod" \
| sed -s 's/.* \(v.[\.0-9]*\).*/\1/')
version_eventing=$(grep "knative.dev/eventing " "${base}/go.mod" \
| sed -s 's/.* \(v.[\.0-9]*\).*/\1/')
echo "-X '${pkg}.BuildDate=${now}' \
-X ${pkg}.Version=${version} \
-X ${pkg}.GitRevision=${rev} \
-X ${pkg}.VersionServing=${version_serving} \
-X ${pkg}.VersionEventing=${version_eventing}\
${EXTERNAL_LD_FLAGS:-}"

I think a good algo could be:

  • For major.minor pick it up from the client version as given. Alternatively, use the info from the go.mod file and apply the "magic" formular of mapping 0.27 to a 1.0 baseline.
  • For patchlevel pick up the patch level value from the go. mod dependency.

@rhuss rhuss added this to the v0.28 milestone Jan 5, 2022
@rhuss rhuss added the backport/candidate Consider this PR to be backported to the release branch label Jan 25, 2022
@rhuss rhuss modified the milestones: 1.2 (0.28), 1.3 (0.29) Jan 25, 2022
@kobayashi
Copy link
Contributor

@rhuss Please let me know if there's anything to be added to this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/candidate Consider this PR to be backported to the release branch kind/bug Categorizes issue or PR as related to a bug. triage/accepted Issues which should be fixed (post-triage)
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants