-
Notifications
You must be signed in to change notification settings - Fork 249
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 functionality to list clustertasks #161
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
/ok-to-test |
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.
@onyiny-ang Looking good 👼 👍
The following is the coverage report on pkg/.
|
/test pull-tekton-cli-build-tests |
- Lists NAME and AGE of clustertasks - Follows existing tkn command structure - Closes tektoncd#118 Just adjust the vendor modules
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
The following is the coverage report on pkg/.
|
pkg/cmd/clustertask/clustertask.go
Outdated
func Command(p cli.Params) *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "clustertask", | ||
Aliases: []string{"c", "clustertasks"}, |
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.
How about ct instead of c
pkg/cmd/clustertask/list.go
Outdated
} | ||
|
||
clustertasks, err := listAllClustertasks(cs.Tekton) | ||
|
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.
nit: may want to remove the blank line
pkg/cmd/clustertask/list.go
Outdated
return nil, err | ||
} | ||
|
||
if len(clustertasks.Items) == 0 { |
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.
isn't this if
superfluous? i.e. wouldn't the output be the same if we deleted it?
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.
Removed from this and task list.go
in follow up commit
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.
Thanks for the patch ❤️
looks good overall but minor comments to address
pkg/cmd/clustertask/list.go
Outdated
Use: "list", | ||
Aliases: []string{"ls"}, | ||
Short: "Lists clustertasks in a namespace", | ||
Long: ``, |
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.
We don't need to add the Long
field if it's empty 😝 (we may need to fix that on other commands)
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.
Fixed and also deleted the "Long" flag from pipelines and task list.go
`
- Removes "Long" command flags that are left blank - Removes superflous "if" statement
The following is the coverage report on pkg/.
|
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: onyiny-ang, 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 |
return clustertasks, nil | ||
} | ||
|
||
func listClustertaskDetails(cs versioned.Interface) (*v1alpha1.ClusterTaskList, error) { |
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.
Could you please help me understand why we need this func ? isn't this the same as listAllClusterTasks
?
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.
Addressed in #165
Changes
Addresses #118: Adding functionality to list ClusterTasks
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
See the contribution guide
for more details.
Release Notes