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

Add kn revision delete command #207

Merged
merged 9 commits into from
Jun 28, 2019

Conversation

navidshaikh
Copy link
Collaborator

Fixes #203

➜  client git:(fix-203)  ./kn revision list
SERVICE   NAME          AGE     CONDITIONS   READY     REASON
hello     hello-2krsg   4s      1 OK / 5     Unknown   Deploying
hello     hello-7w8z7   47m     4 OK / 5     True      
kn1       kn1-kcwt7     9m23s   4 OK / 5     True      
svc1      svc1-j7hqr    23h     4 OK / 5     True      

➜  client git:(fix-203)  ./kn revision delete hello-7w8z7
Revision 'hello-7w8z7' successfully deleted in namespace 'default'.

➜  client git:(fix-203)  ./kn revision list              
SERVICE   NAME          AGE     CONDITIONS   READY   REASON
hello     hello-2krsg   16s     5 OK / 5     True    
kn1       kn1-kcwt7     9m35s   4 OK / 5     True    
svc1      svc1-j7hqr    23h     4 OK / 5     True    

@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Jun 25, 2019
@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 Jun 25, 2019
@knative-prow-robot
Copy link
Contributor

Hi @navidshaikh. 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/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 25, 2019
@navidshaikh
Copy link
Collaborator Author

/ok-to-test

@knative-prow-robot
Copy link
Contributor

@navidshaikh: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/ok-to-test

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.

@navidshaikh navidshaikh changed the title Adds kn revision delete command Add kn revision delete command Jun 25, 2019
@sixolet
Copy link
Contributor

sixolet commented Jun 25, 2019

/ok-to-test

@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. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 25, 2019
@rhuss
Copy link
Contributor

rhuss commented Jun 25, 2019

Is think there's a race in the test

Running 'kn service update hello --env TARGET=kn -n kne2etests'...
Failed to successfully execute 'kn service update hello --env TARGET=kn -n kne2etests': Execution error: stderr: 'Operation cannot be fulfilled on services.serving.knative.dev "hello": the object has been modified; please apply your changes to the latest version and try again
' error: 'exit status 1'FAIL	github.com/knative/client/test/e2e	0.528s

@rhuss
Copy link
Contributor

rhuss commented Jun 25, 2019

Or update is broken.

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.

Unit and integration tests?

@navidshaikh
Copy link
Collaborator Author

@maximilien : Thanks for review, I've updated the PR with unit and integration tests (added TestRevisionWorkflow, as IMO this isn't basic workflow).

@navidshaikh
Copy link
Collaborator Author

Is think there's a race in the test

@rhuss : Yup, in this e2e run TestBasicWorkflow passed.
`

@rhuss
Copy link
Contributor

rhuss commented Jun 28, 2019

Oops, test failures ;-(

@navidshaikh
Copy link
Collaborator Author

/retest

Copy link
Contributor

@rhuss rhuss left a comment

Choose a reason for hiding this comment

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

Some minor nit-picks, otherwise looks fine for me. Thanks !

pkg/kn/commands/revision/delete.go Outdated Show resolved Hide resolved
pkg/kn/commands/revision/delete.go Show resolved Hide resolved
pkg/kn/commands/revision/delete_test.go Outdated Show resolved Hide resolved
pkg/kn/commands/revision/delete_test.go Outdated Show resolved Hide resolved
pkg/kn/commands/revision/delete_test.go Outdated Show resolved Hide resolved
pkg/kn/commands/revision/delete_test.go Show resolved Hide resolved
pkg/wait/wait_for_ready.go Show resolved Hide resolved
test/e2e/revision_workflow_test.go Outdated Show resolved Hide resolved
@rhuss rhuss self-assigned this Jun 28, 2019
@navidshaikh
Copy link
Collaborator Author

@rhuss : Thanks for the review, updated the PR, PTAL.

@rhuss
Copy link
Contributor

rhuss commented Jun 28, 2019

# github.com/knative/client/test/e2e [github.com/knative/client/test/e2e.test]
test/e2e/revision_workflow_test.go:20:2: imported and not used: "fmt"

} else if name != revName {
t.Errorf("Bad revision name returned after delete.")
}
commands.TestContains(t, output, []string{"Revision", revName, "deleted", "namespace", commands.FakeNamespace}, "word in output")
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice 👍

@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: navidshaikh, rhuss

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

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 28, 2019
@knative-metrics-robot
Copy link

The following is the coverage report on pkg/.
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 Do not exist 75.0%

@rhuss
Copy link
Contributor

rhuss commented Jun 28, 2019

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 28, 2019
@knative-prow-robot knative-prow-robot merged commit 65f1c08 into knative:master Jun 28, 2019
maximilien pushed a commit to maximilien/client that referenced this pull request Jul 1, 2019
* Adds kn revision delete command

* Adds unit tests for revision delete command

* Adds integration tests for revision delete command

 Added revision delete command tests in new workflow namely
 TestRevisionWorkflow.

* Removes extra line and renames an import alias

* Adds 10 seconds sleep between service create and revision delete

 Also adds check for 'No resources found' while grabbing revision name.

* Clean up imports

* Removes the pause after service create

* Updates testing output strings in unit and e2e

* Updates post goimports on hack and test dirs
@navidshaikh navidshaikh deleted the fix-203 branch November 18, 2019 12:38
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.

Implement kn revision delete command
7 participants