-
Notifications
You must be signed in to change notification settings - Fork 255
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
Fix client version output with --component option #1408
Fix client version output with --component option #1408
Conversation
Hi @anshulvermapatel. Thanks for your PR. I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the 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. |
/ok-to-test |
The following is the coverage report on the affected files.
|
I think we need to test in this command, or move the logic block out of Command in a package in pkg/version for example to better make it testable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment 👼🏼
if component == "" { | ||
fmt.Fprintf(cmd.OutOrStdout(), "Client version: %s\n", clientVersion) | ||
} else { | ||
fmt.Fprintf(cmd.OutOrStdout(), "%s\n", clientVersion) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is right though, because as is, tkn version --component=pipeline
with a error connecting kubernetes, it will print the client version without an error, which doesn't make sense to me.
We should print the client version if the component is client
, otherwise we should either error out or print unknown
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, my bad.
I will correct it.
2da4451
to
37f5b9c
Compare
@chmouel , made the tests for this better .. still kept the block in cmd itself as it was a small change. Please do suggest once your review. |
The following is the coverage report on the affected files.
|
/retest |
Resolved an issue where the client version as component was being printed as the output of client version without adding `--component`
37f5b9c
to
8808c7e
Compare
The following is the coverage report on the affected files.
|
} | ||
got, _ := test.ExecuteCommand(version, "version", "-n", "test", "--component", c) | ||
fmt.Println(t.Name()) | ||
golden.Assert(t, got, fmt.Sprintf("%s-%s.golden", t.Name(), c)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of generating golden files can't we just do assert?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tend to agree with @vinamra28, could be a follow-up though 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure. I'll track this in an issue and merge this one 🙂
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vdemeester 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 |
/lgtm |
/retest |
1 similar comment
/retest |
/lgtm |
/test pull-tekton-cli-integration-tests |
/retest |
#1409 | [Pradeep Kumar] update readme cli version to v0.19.1 | 2021/06/30-15:54 #1410 | [laminar] Fix CLI installation instructions for deb-based distros | 2021/07/05-10:15 #1393 | [vinamra28] Get tekton components version from configmap | 2021/07/07-09:09 #1411 | [vinamra28] Bump pipelines v0.25.0, triggers 0.14.2 and hub | 2021/07/07-12:05 #1415 | [Vincent Demeester] Force cancel when using tkn pipelinerun cancel 👼 | 2021/07/09-09:48 #1408 | [Anshul Verma] resloves issue/1395 | 2021/07/09-10:12 #1385 | [Nikhil Thomas] Fix TaskRun order in `tkn pr logs` | 2021/07/13-06:13 Signed-off-by: Pradeep Kumar <[email protected]>
tektoncd#1409 | [Pradeep Kumar] update readme cli version to v0.19.1 | 2021/06/30-15:54 tektoncd#1410 | [laminar] Fix CLI installation instructions for deb-based distros | 2021/07/05-10:15 tektoncd#1393 | [vinamra28] Get tekton components version from configmap | 2021/07/07-09:09 tektoncd#1411 | [vinamra28] Bump pipelines v0.25.0, triggers 0.14.2 and hub | 2021/07/07-12:05 tektoncd#1415 | [Vincent Demeester] Force cancel when using tkn pipelinerun cancel 👼 | 2021/07/09-09:48 tektoncd#1408 | [Anshul Verma] resloves issue/1395 | 2021/07/09-10:12 tektoncd#1385 | [Nikhil Thomas] Fix TaskRun order in `tkn pr logs` | 2021/07/13-06:13 Signed-off-by: Pradeep Kumar <[email protected]>
Resolves #1395
Resolved an issue where the client version with
--component
option was beingprinted same as the output of client version without adding
--component
Changes
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
make check
make generated
See the contribution guide
for more details.
Release Notes