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

Add version flag #136

Merged
merged 1 commit into from
Dec 5, 2018
Merged

Add version flag #136

merged 1 commit into from
Dec 5, 2018

Conversation

dkoshkin
Copy link
Contributor

@dkoshkin dkoshkin commented Dec 4, 2018

Is this a bug fix or adding new feature?
Fixes #21

What is this PR about? / Why do we need it?
This PR adds --version flag at the top level command.
Running aws-ebs-csi-driver --version will pretty print the JSON, with the same format as kubectl version.

This PR does not add support for printing the info in any other format.

What testing is done?
Locally built the image and tested:

➜  aws-ebs-csi-driver git:(version) ✗ docker run -it amazon/aws-ebs-csi-driver:0.1.0-alpha --version
{
  "driverVersion": "0.1.0-alpha",
  "gitCommit": "c7b3689df8a5cdf212ca80f9f0332ac3d518eefc",
  "buildDate": "2018-12-04T18:45:21Z",
  "goVersion": "go1.11.1",
  "compiler": "gc",
  "platform": "linux/amd64"
}

I am not aware of a way to unit test when using -ldflags, if anyone has some pointers would be glad to add a unit test.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Dec 4, 2018
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 4, 2018
@k8s-ci-robot
Copy link
Contributor

Hi @dkoshkin. Thanks for your PR.

I'm waiting for a kubernetes-sigs or kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@coveralls
Copy link

coveralls commented Dec 4, 2018

Pull Request Test Coverage Report for Build 218

  • 15 of 18 (83.33%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.6%) to 51.596%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/driver/identity.go 0 1 0.0%
pkg/driver/version.go 15 17 88.24%
Totals Coverage Status
Change from base Build 217: 0.6%
Covered Lines: 582
Relevant Lines: 1128

💛 - Coveralls

@leakingtapan
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 5, 2018
Makefile Outdated Show resolved Hide resolved
@leakingtapan
Copy link
Contributor

@dkoshkin thanks for the PR. For the unit test, could you create a version_test.go and just test the struct and methods within the file to get us some coverage?

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 5, 2018
@leakingtapan
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 5, 2018
@leakingtapan
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dkoshkin, leakingtapan

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 5, 2018
@k8s-ci-robot k8s-ci-robot merged commit 698f760 into kubernetes-sigs:master Dec 5, 2018
@dkoshkin dkoshkin deleted the version branch December 5, 2018 18:33
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add version command to ebs-csi-driver cmd
4 participants