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

Refactored delete.go file for customrun #2390

Merged
merged 1 commit into from
Aug 29, 2024

Conversation

Senjuti256
Copy link
Contributor

@Senjuti256 Senjuti256 commented Aug 28, 2024

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:

  • Includes tests (if functionality changed/added)
  • Run the code checkers with make check
  • Regenerate the manpages, docs and go formatting with make generated
  • Commit messages follow commit message best practices

See the contribution guide
for more details.

Release Notes

Refactored delete.go file for customrun delete command

@tekton-robot tekton-robot added the do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. label Aug 28, 2024
@tekton-robot
Copy link
Contributor

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 /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.

@tekton-robot tekton-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 28, 2024
"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 {
Copy link
Contributor

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

@@ -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)
Copy link
Contributor

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

@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Aug 28, 2024
@piyush-garg
Copy link
Contributor

/ok-to-test

@tekton-robot tekton-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 Aug 29, 2024
@piyush-garg
Copy link
Contributor

/retest

1 similar comment
@Senjuti256
Copy link
Contributor Author

/retest

@piyush-garg
Copy link
Contributor

/approve
/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 29, 2024
@tekton-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 29, 2024
@tekton-robot tekton-robot merged commit a061d5a into tektoncd:main Aug 29, 2024
8 checks passed
vinamra28 added a commit that referenced this pull request Sep 10, 2024
#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 <vinjain@redhat.com>
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. lgtm 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. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants