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

delete application #84

Merged
merged 6 commits into from
Jan 31, 2017
Merged

delete application #84

merged 6 commits into from
Jan 31, 2017

Conversation

noahdietz
Copy link
Contributor

Fixes #83
Fixes kiln's part in #3

  • removes ability to delete app image revision
  • adds ability to remove all revisions of an app
  • adds check to k8s deployments for active use of app targeted for deletion
  • adds a k8s dependency to vendor

* no safeguard for deleting deployed application images
* removes revision deletion endpoint and interfaces
* adds k8s cluster config to start up
* adds test for app delete
* adds local repo deletion
main.go Outdated
@@ -53,6 +53,11 @@ func main() {

kiln.LogInfo.Printf("ImageCreator set up.")

clusterConfig, err := kiln.NewClusterConfig()

Choose a reason for hiding this comment

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

I think we should support out of cluster kubernetes client like we do in enrober/dispatcher as well. See: https://github.com/30x/enrober/blob/staging/pkg/server/server.go#L83-L113

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made a function to get a local config. I'll follow the config for this that y'all are doing.

}

// uses the current context in kubeconfig
config, err := clientcmd.BuildConfigFromFlags("", path.Join(usr.HomeDir, ".kube/config"))

Choose a reason for hiding this comment

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

Kubernetes clientcmd provides a way of doing this automatically instead of generating when the kube config is by hand. See: https://godoc.org/k8s.io/client-go/tools/clientcmd#BuildConfigFromFlags

It's the same code we use enrober and dispatcher I would vote we use the same logic in all three projects. https://github.com/30x/dispatcher/blob/master/kubernetes/client.go#L54-L62 and https://github.com/30x/enrober/blob/staging/pkg/server/server.go#L97-L111.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree. I do think that if there are more than a few lines of code to use this in each project that we bubble it up into a shared package. But we can do that later.


if active {
w.WriteHeader(http.StatusConflict)
w.Header().Set("Content-Type", "text/plain charset=utf-8")
Copy link
Contributor

Choose a reason for hiding this comment

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

All of our API errors should be JSON. I think enrober is already returning an error structure so you might want to look at that for the existing pattern.

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