-
Notifications
You must be signed in to change notification settings - Fork 263
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 --prune & --prune-all options to delete the unreferenced revisions #1217
Add --prune & --prune-all options to delete the unreferenced revisions #1217
Conversation
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.
@Kaustubh-pande: 2 warnings.
In response to this:
Description
As per the review comment #317
Changes
- Add --all option to delete all the revisions
Reference
Fixes #317
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.
Hi @Kaustubh-pande. 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 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. |
3d97334
to
26c1697
Compare
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.
Nice. Thanks for contribution.
/ok-to-test
/lgtm
/hold to allow others a chance to review
/retest |
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.
@rhuss : Rethinking on this command, if user deletes all the revisions, the one (or may be multiple) receiving the traffic will be recreated. Should we have this option then ? (as it tries to change the desire state)
Instead, we may consider kn revision delete --unused
or kn revision delete --prune
to inspect the revisions not receiving the traffic and delete them. wdyt?
@navidshaikh, @rhuss I think |
I agree that we should not unconditionally delete all revisions, as this can (a) lead to an inconsistent state (e.g. when a revision is part of a traffic split) and (b) one of the revision would be recreated anyway. So my suggestion is to add either a |
ed452c1
to
c97596a
Compare
/retest |
I don't know by heart but is this PR about delete all revisions in a namespace or only revisions for a specific service ? I think it really should be about deleting revisions for a given service as I think this is the main use case. So, from UX pov I see the following options that I would love to see
sorry for reiterating on this, but I think this is important. |
c97596a
to
f327b64
Compare
4abc429
to
7d50aba
Compare
@Kaustubh-pande @navidshaikh @dsimansk what is left for this PR to get merged ? (sorry, have not followed up the latest changes of the PR) |
sorry, I was off for a couple of days, I will push a commit today. |
/retest |
1afc4fe
to
a33bddf
Compare
/retest |
1 similar comment
/retest |
a33bddf
to
022715c
Compare
The following is the coverage report on the affected files.
|
/retest |
/lgtm |
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
/unhold
suggested a few nits which can be fixed in a follow up, thanks!
@@ -139,3 +139,17 @@ func RevisionListWithService(r *KnRunResultCollector, serviceNames ...string) { | |||
} | |||
} | |||
} | |||
|
|||
// RevisionDeleteWithPruneOption verifies removeing all unreferenced revisions for a given service in sync mode |
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.
// RevisionDeleteWithPruneOption verifies removeing all unreferenced revisions for a given service in sync mode | |
// RevisionDeleteWithPruneOption verifies removing all unreferenced revisions for a given service in sync mode |
r.AssertNoError(out) | ||
} | ||
|
||
// RevisionDeleteWithPruneAllOption verifies removeing all unreferenced revision in sync mode |
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.
// RevisionDeleteWithPruneAllOption verifies removeing all unreferenced revision in sync mode | |
// RevisionDeleteWithPruneAllOption verifies removing all unreferenced revision in sync mode |
fmt.Fprintf(cmd.OutOrStdout(), "No unreferenced revisions found.\n") | ||
return nil | ||
} | ||
} |
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 can create the client first and then replace the multiple if/else with switch
@@ -59,6 +59,25 @@ func TestRevision(t *testing.T) { | |||
nonexistRevision := "hello-nonexist" | |||
test.RevisionMultipleDelete(r, existRevision1, existRevision2, nonexistRevision) | |||
|
|||
t.Log("update hello service and increase revision count to 4") |
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.
t.Log("update hello service and increase revision count to 4") | |
t.Log("update hello service and increase revision count") |
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.
since the revisions are being deleted in above tests
unRefRevision := test.FindRevisionByGeneration(r, "hello", 3) | ||
test.RevisionDeleteWithPruneOption(r, "hello", unRefRevision) | ||
|
||
t.Log("update hello service and increase revision count to 5") |
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.
t.Log("update hello service and increase revision count to 5") | |
t.Log("update hello service and increase revision count") |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 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:
Approvers can indicate their approval by writing |
/test pull-knative-client-integration-tests-latest-release |
Description
As per the review comment #317
Changes
Reference
Fixes #317