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

oras version #69

Merged
merged 11 commits into from
Apr 17, 2019
Merged

oras version #69

merged 11 commits into from
Apr 17, 2019

Conversation

shizhMSFT
Copy link
Contributor

Run oras version to print the version.

$ bin/linux/amd64/oras version
Version:        0.4.0+unreleased
Go version:     go1.11.1
Git commit:     04121d7b0c35b067a1c58dd5ff42a0006358bc76
Git tree state: clean

Resolves #49

@shizhMSFT shizhMSFT added the enhancement New feature or request label Apr 15, 2019
@bacongobbler
Copy link

bacongobbler commented Apr 16, 2019

The downside to this approach will be how client libraries use oras. This package will be completely useless outside of a CLI context because the version fields are generated as runtime compile flags, so exposing it as a pkg won't be very useful for others.

Perhaps it'd be better to make this package internal like we're doing in Helm 3. See https://github.com/helm/helm/blob/dev-v3/internal/version/version.go

@jdolitsky
Copy link
Contributor

@bacongobbler the code looks pretty similar - are you just suggesting to add a public Get() method vs. having public vars like Version etc?

@bacongobbler
Copy link

bacongobbler commented Apr 16, 2019

No, I'm suggesting moving pkg/version to internal/version. Helm or other packages can't use this package unless those variables were part of the package as a constant rather than injected at compile time through compiler flags.

@shizhMSFT
Copy link
Contributor Author

/test

@shizhMSFT shizhMSFT merged commit bf2ff5d into master Apr 17, 2019
@shizhMSFT shizhMSFT deleted the shizh/version branch April 17, 2019 03:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

oras version command
3 participants