-
Notifications
You must be signed in to change notification settings - Fork 250
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
Refactored delete.go file for customrun #2390
Conversation
Hi @Senjuti256. 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. |
pkg/cmd/customrun/delete.go
Outdated
"k8s.io/apimachinery/pkg/api/errors" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
"k8s.io/cli-runtime/pkg/genericclioptions" | ||
) | ||
|
||
func crExists(args []string, p cli.Params) ([]string, error) { | ||
availableCrs := make([]string, 0) | ||
func crExists(args string, p cli.Params) 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.
can you please rename the function as customRunExists
also can you rename the argument from args
to name
pkg/cmd/customrun/delete.go
Outdated
@@ -100,14 +88,14 @@ func deleteCustomRuns(s *cli.Stream, p cli.Params, crNames []string) error { | |||
namespace := p.Namespace() | |||
for _, crName := range crNames { | |||
// Check if CustomRun exists before attempting deletion | |||
exists, _ := crExists([]string{crName}, p) | |||
if len(exists) == 0 { | |||
err := crExists(crName, p) |
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.
as we are creating client before, can we pass client
and namespace
, instead of p
7321f8e
to
99ff54a
Compare
99ff54a
to
89841ca
Compare
/ok-to-test |
/retest |
1 similar comment
/retest |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: piyush-garg 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 |
#2380 | [dependabot[bot]] Bump github.com/golangci/golangci-lint from 1.60.1 to 1.60.2 in /tools | 2024/08/22-08:46 #2382 | [Piyush Garg] Move to goreleaser v2 | 2024/08/22-12:00 #2383 | [Piyush Garg] Update docs for 0.38.0 release | 2024/08/23-12:10 #2384 | [dependabot[bot]] Bump github.com/golangci/golangci-lint from 1.60.2 to 1.60.3 in /tools | 2024/08/23-16:24 #2385 | [dependabot[bot]] Bump github.com/tektoncd/pipeline from 0.62.1 to 0.62.2 | 2024/08/23-17:18 #2387 | [Piyush Garg] Fix ubuntu launchpad build | 2024/08/26-09:12 #2386 | [Piyush Garg] Remove hardcoded golangci-lint and go version | 2024/08/26-09:46 #2386 | [Piyush Garg] Fix golint error | 2024/08/26-09:46 #2389 | [dependabot[bot]] Bump the go-docker-dependencies group with 2 updates | 2024/08/29-03:27 #2390 | [Senjuti De] Refactored delete.go file for customrun | 2024/08/29-07:49 null | [Piyush Garg] Bump tektoncd/pipeline to v0.62.3 | 2024/09/04-05:09 null | [dependabot[bot]] Bump github.com/tektoncd/triggers from 0.29.0 to 0.29.1 | 2024/09/05-12:19 null | [dependabot[bot]] Bump the go-docker-dependencies group with 2 updates | 2024/09/10-10:39 Signed-off-by: vinamra28 <[email protected]>
Refactored the delete.go file for customrun delete command.
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