openshift / openshift/oc

Missing vX.Y.Z tags cause wrong version report

Open
#1,688 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

lifecycle/frozen
Dominant language
Go
Stars
247
Forks
475
Avg merge
4d 9h
Merged PRs (30d)
11

Description

Hi, I successfully built the oc tool from source, but when I run oc version it reports Client Version: v4.2.0-alpha.0-1997-g0c63f9d. However, I am at the tag openshift-clients-4.14.0-202310201027.

I looked for the cause and found that during make oc, the command git describe --long --tags --abbrev=7 --match 'v[0-9]*' || echo 'v0.0.0-unknown-$(SOURCE_GIT_COMMIT)' is run. It looks for the latest tag in v<version> format. However, the last tag, that satisfies this format, is v4.2.0-alpha.0.

I know I can get around this by setting SOURCE_GIT_TAG or OS_GIT_VERSION to v4.14.0, but for me the correct solution seems to be adding appropriate tags to make the auto-detection work.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with vendor/github.com/openshift/build-machinery-go/make/lib/golang.mk at the git describe command used by make oc, then inspect the repository's existing tag history and version variables. Done means adding appropriate vX.Y.Z tags so oc version detects the current release instead of v4.2.0-alpha.0.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, go
Domain
build-system, cli, release
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.