Skip to content
This repository has been archived by the owner on Aug 17, 2023. It is now read-only.

kfctl delete refactor #309

Merged
merged 2 commits into from
Apr 15, 2020

Conversation

yanniszark
Copy link
Contributor

Fixes: #293

Refactor the kfctl deletion algorithm as described in the issue.

@kubeflow-bot
Copy link

This change is Reviewable

@yanniszark
Copy link
Contributor Author

/retest

@yanniszark yanniszark force-pushed the feature-kfctl-delete-rewrite branch 5 times, most recently from ccdd07d to 6f3bff5 Compare April 15, 2020 12:14
Refactor the kfctl deletion algorithm as described in issue
kubectl/kfctl#293:

1. Build kustomize folder if necessary
2. For every application in reverse KfDef order, do an equivalent of
   `kustomize build | kubectl delete -f -`

Signed-off-by: Yannis Zarkadas <yanniszark@arrikto.com>
@yanniszark yanniszark force-pushed the feature-kfctl-delete-rewrite branch from 6f3bff5 to eede9b1 Compare April 15, 2020 12:15
@yanniszark
Copy link
Contributor Author

@adrian555 @Tomcli @kunmingg @jlewi this is ready for review.
I have tested it in my Kubeflow cluster multiple times.

Copy link
Member

@adrian555 adrian555 left a comment

Choose a reason for hiding this comment

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

thanks @yanniszark a couple of comments below.

@@ -350,36 +346,84 @@ func (kustomize *kustomize) Delete(resources kftypesv3.ResourceEnum) error {
Message: msg,
}
}
}
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if line 339 to line 349 are still needed when line 361 below already handles the empty case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch, you're right!

return &kfapisv3.KfError{
Code: int(kfapisv3.INVALID_ARGUMENT),
Message: msg,
Code: int(kfapisv3.INTERNAL_ERROR),
Copy link
Member

Choose a reason for hiding this comment

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

Should we continue to delete the rest as a best effort or quit immediately?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good question 🤔
I usually think it's good to fail early.
On the other hand, kubectl tries to delete everything regardless.
We may want to stay close to kubectl behavior as in the future people will probably use it.

Signed-off-by: Yannis Zarkadas <yanniszark@arrikto.com>
@yanniszark
Copy link
Contributor Author

@adrian555 I made changes as per the review.
It's ready for another pass whenever possible 😄

@adrian555
Copy link
Member

Looks good, thanks @yanniszark.

/lgtm

@yanniszark
Copy link
Contributor Author

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: yanniszark

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

@k8s-ci-robot k8s-ci-robot merged commit 660fae1 into kubeflow:master Apr 15, 2020
vpavlin pushed a commit to vpavlin/kfctl that referenced this pull request Jul 20, 2020
* kustomize: Refactor deletion algorithm

Refactor the kfctl deletion algorithm as described in issue
kubectl/kfctl#293:

1. Build kustomize folder if necessary
2. For every application in reverse KfDef order, do an equivalent of
   `kustomize build | kubectl delete -f -`

Signed-off-by: Yannis Zarkadas <yanniszark@arrikto.com>

* Don't fail early, attempt to delete everything

Signed-off-by: Yannis Zarkadas <yanniszark@arrikto.com>
crobby pushed a commit to crobby/kfctl that referenced this pull request Feb 25, 2021
* kustomize: Refactor deletion algorithm

Refactor the kfctl deletion algorithm as described in issue
kubectl/kfctl#293:

1. Build kustomize folder if necessary
2. For every application in reverse KfDef order, do an equivalent of
   `kustomize build | kubectl delete -f -`

Signed-off-by: Yannis Zarkadas <yanniszark@arrikto.com>

* Don't fail early, attempt to delete everything

Signed-off-by: Yannis Zarkadas <yanniszark@arrikto.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve the kfctl delete algorithm
4 participants