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

Fix exit code on service delete and revision delete #971

Merged
merged 7 commits into from
Aug 6, 2020
Merged

Fix exit code on service delete and revision delete #971

merged 7 commits into from
Aug 6, 2020

Conversation

hemanrnjn
Copy link
Contributor

@hemanrnjn hemanrnjn commented Aug 4, 2020

Description

Fixed exit code issue on service delete

Changes

  • Fixed exit code to 1 which was earlier returned upon any failure of kn service delete

Reference

Fixes #960

@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Aug 4, 2020
Copy link
Contributor

@knative-prow-robot knative-prow-robot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hemanrnjn: 0 warnings.

In response to this:

Description

Changes

  • Fixed exit code to 1 which was earlier returned upon any failure of kn service delete

Reference

Fixes #960

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.

@knative-prow-robot knative-prow-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 4, 2020
@knative-prow-robot
Copy link
Contributor

Hi @hemanrnjn. Thanks for your PR.

I'm waiting for a knative 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.

@knative-prow-robot knative-prow-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Aug 4, 2020
@knative-prow-robot knative-prow-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 4, 2020
Copy link
Collaborator

@navidshaikh navidshaikh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/ok-to-test

@hemanrnjn : needs rebase + add some tests ?

@knative-prow-robot knative-prow-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 4, 2020
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 4, 2020
Copy link
Contributor

@maximilien maximilien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment. Please address. Thanks.

/test pull-knative-client-integration-tests

pkg/kn/commands/service/delete.go Show resolved Hide resolved
@gosoon
Copy link
Contributor

gosoon commented Aug 5, 2020

kn all command failed exited code is 0,does this need to be modified uniformly?

@hemanrnjn hemanrnjn changed the title Fix exit code on service delete WIP: Fix exit code on service delete Aug 5, 2020
@knative-prow-robot knative-prow-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 5, 2020
@knative-prow-robot knative-prow-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 5, 2020
@hemanrnjn
Copy link
Contributor Author

kn all command failed exited code is 0,does this need to be modified uniformly?

Can you tell me more specifically with exactly what command you encountered this issue?

@navidshaikh
Copy link
Collaborator

/retest

  result_collector.go:75: ERROR: Error: ReconcileIngressFailed: Ingress reconciliation failed

@gosoon
Copy link
Contributor

gosoon commented Aug 5, 2020

kn all command failed exited code is 0,does this need to be modified uniformly?

Can you tell me more specifically with exactly what command you encountered this issue?

I read the code and found no default error exit code,I tested some commands and found that part of the exit code was 1 and most of the exit code was 0.

$ kn service delete a
services.serving.knative.dev "a" not found.
$ echo $?
0
$ kn revision delete a
revisions.serving.knative.dev "a" not found.
$ echo $?
0

@navidshaikh
Copy link
Collaborator

+1 its the bug in revision delete command as well, @hemanrnjn might want to apply the fix for revisions too ?

@hemanrnjn
Copy link
Contributor Author

+1 its the bug in revision delete command as well, @hemanrnjn might want to apply the fix for revisions too ?

In this PR or a separate PR?

@hemanrnjn hemanrnjn changed the title WIP: Fix exit code on service delete WIP: Fix exit code on service delete and revision delete Aug 5, 2020
@maximilien
Copy link
Contributor

maximilien commented Aug 5, 2020

LGTM once we can pass tests again. Also, should the "WIP" prefix be removed from title, or do you have more planned for this PR @hemanrnjn?

@hemanrnjn
Copy link
Contributor Author

LGTM once we can pass tests again. Also, should the "WIP" prefix be removed from title, or do you have more planned for this PR @hemanrnjn?

Not anything additional. Just looking into the cause of the failures of the integration tests as it might need some changes. I will remove WIP right after.

@knative-prow-robot knative-prow-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 Aug 6, 2020
@knative-metrics-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-knative-client-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/kn/commands/revision/delete.go 77.3% 84.0% 6.7
pkg/kn/commands/service/delete.go 84.1% 87.2% 3.1

@hemanrnjn hemanrnjn changed the title WIP: Fix exit code on service delete and revision delete Fix exit code on service delete and revision delete Aug 6, 2020
@knative-prow-robot knative-prow-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 6, 2020
Copy link
Collaborator

@navidshaikh navidshaikh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

thanks for the contribution!

@@ -136,12 +136,12 @@ func serviceMultipleDelete(r *test.KnRunResultCollector, existService, nonexistS
assert.Check(r.T(), !strings.Contains(out.Stdout, nonexistService), "The service", nonexistService, " exists (but is supposed to be not)")

out = r.KnTest().Kn().Run("service", "delete", existService, nonexistService)
r.AssertNoError(out)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 6, 2020
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hemanrnjn, maximilien, navidshaikh

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:
  • OWNERS [maximilien,navidshaikh]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot merged commit 980a6a9 into knative:master Aug 6, 2020
@navidshaikh navidshaikh added the backport/candidate Consider this PR to be backported to the release branch label Aug 18, 2020
navidshaikh pushed a commit to navidshaikh/client that referenced this pull request Aug 18, 2020
* Fix exit code 0 upon service delete

* Mentioned bug fix in CHANGELOG.adoc

* Add error check test for service not found

* Fix for kn revision delete failure exit code and add test cases

* Testing changes in test cases for failure in intergration tests

* Fix test case error causing integration test failure
knative-prow-robot pushed a commit that referenced this pull request Aug 19, 2020
* fix(docs): Fix tekton task link in README (#934)

* Fix missing NAMESPACE column header (#951)

* Fix missing NAMESPACE column header

* Fix missing namespace column header for 'kn source list -A'

* List inbuilt sources if CRD access is restricted (#948)

* List inbuilt sources if CRD access is restricted

 Fixes #947
 - Identify restricted access error
 - If server returns restricted access error, fallback to listing
   only eventing inbuilt sources using their GVKs.
 - List any inbuilt source (ApiServerSource) object and read the error
   to know if eventing is installed for `kn source list-types`.

* Fix golint warnings

* Remove unused imports

* Verify each built in source before listing source types

* Improve the check if sources are not installed in the cluster

* Update finding forbidden error

* Update finding errors

* Add unit tests for IsForbiddenError util

* Add unit tests

* Add tests for dynamic pkg library

* Add unit tests for case when no sources are installed

* Update test name

* Use Tekton Catalog GA structure for tasks (#966)

* fix: `kn source list` command print spelling problems (#963)

* Fix exit code on service delete and revision delete (#971)

* Fix exit code 0 upon service delete

* Mentioned bug fix in CHANGELOG.adoc

* Add error check test for service not found

* Fix for kn revision delete failure exit code and add test cases

* Testing changes in test cases for failure in intergration tests

* Fix test case error causing integration test failure

* fix(volume): Generate volume name compliant with DNS Label names (#975)

* fix(volume): Volume names to not contain dots

 Replace non alphanumberic characters with hyphen as the
 volumen name must be a DNS_LABEL (https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-label-names)
 ref: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#volume-v1-core

* Generate volume name compliant with DNS Label names

 Volume names to follow the DNS label standard as defined in RFC 1123. This means the name must:
 - contain at most 63 characters
 - contain only lowercase alphanumeric characters or '-'
 - start with an alphanumeric character
 - end with an alphanumeric character

* Set client custom GVK for source list for machine readable output (#980)

- Use custom GVK {Group: client.knative.dev, Version: v1alpha1, Kind: SourceList}
 - Source list may contain different source types CO and machine readable output (using -o)
   requires List object to have GVK set, since the list contains different types of source COs,
   we set a custom client GVK on it.

 Fixes #953

* Update CHANGELOG for v0.16.1

Co-authored-by: kaustubh <[email protected]>
Co-authored-by: Chris Suszynski <[email protected]>
Co-authored-by: tianfeiyu <[email protected]>
Co-authored-by: Himanshu Ranjan <[email protected]>
rhuss pushed a commit to rhuss/knative-client that referenced this pull request Sep 9, 2020
* Fix exit code 0 upon service delete

* Mentioned bug fix in CHANGELOG.adoc

* Add error check test for service not found

* Fix for kn revision delete failure exit code and add test cases

* Testing changes in test cases for failure in intergration tests

* Fix test case error causing integration test failure
@navidshaikh navidshaikh added backported-to/0.16 and removed backport/candidate Consider this PR to be backported to the release branch labels Oct 12, 2020
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. cla: yes Indicates the PR's author has signed the CLA. 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. 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.

"kn service delete" exited with code ZERO when it ran into failure
7 participants