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

Cluster edit(patch) and delete #15

Merged
merged 13 commits into from
Aug 4, 2017
Merged

Cluster edit(patch) and delete #15

merged 13 commits into from
Aug 4, 2017

Conversation

auhlig
Copy link
Member

@auhlig auhlig commented Jul 26, 2017

Fixes #5.
See 2nd commit.
Unclear, why swagger generated so many new lines in 4f952c808667a468ff370ade14535c1ee0b8acf9.

@auhlig auhlig requested review from BugRoger and databus23 July 26, 2017 15:40
@databus23
Copy link
Member

@auhlig Which version of go-swagger did you install ( swagger version)? I'm assuming you pulled a new version and thats the reason for the larger diff.

Copy link
Member

@databus23 databus23 left a comment

Choose a reason for hiding this comment

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

This PR is only deleting the TPR but not the actual cluster which is deployed via helm. This definitely needs to be done in the groundctl controller and not the apiservers web request.

We further need to decide if we want to just react to the TPR deletion or as I previously suggested have a proper deleting lifecycle for the resource.

@BugRoger Thoughts?

Makefile Outdated
@@ -50,5 +50,6 @@ ifndef HAS_GLIDE
brew install glide
endif
ifndef HAS_SWAGGER
brew tap go-swagger/go-swagger
Copy link
Member

Choose a reason for hiding this comment

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

Need to use tabs in makefiles. Spaces won't work.

}

func (d *deleteCluster) Handle(params operations.DeleteClusterParams, principal *models.Principal) middleware.Responder {
if err := d.rt.Clients.TPRClient().Delete().Namespace("kubernikus").Resource(tprv1.KlusterResourcePlural).LabelsSelectorParam(accountSelector(principal)).Name(params.Name).Do().Error(); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

This is deleting the TPR resource right away. I would favour an approach where we just updated the resources into a KlusterTerminating status or something and take care of removing the cluster and all other resources before we delete the TPR.

Copy link
Contributor

Choose a reason for hiding this comment

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

I would go with a DELETE lifecycle that is out-of-band with the deletion of the TPR.

@auhlig
Copy link
Member Author

auhlig commented Aug 2, 2017

@databus23 I'm using

swagger version
version: 0.11.0
commit: 8135eb6728e43b73489e80f94426e6d387809502

@databus23
Copy link
Member

databus23 commented Aug 2, 2017

Yeah, I had used a previous version:

swagger version
version: 0.10.0
commit: 4d1e79b5a98c6f67bbf06923643d5317ed37a058

So the massive changes are ok I would say.

@auhlig auhlig force-pushed the cluster_deletion branch from 4f952c8 to 218f27c Compare August 3, 2017 11:49
@auhlig auhlig force-pushed the cluster_deletion branch from 218f27c to f5d5ef2 Compare August 3, 2017 11:50
@auhlig auhlig changed the title Cluster deletion Cluster edit(patch) and delete Aug 3, 2017
@databus23 databus23 merged commit 44249f2 into master Aug 4, 2017
@databus23 databus23 deleted the cluster_deletion branch August 4, 2017 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants