Azure / draft-classic

A tool for developers to create cloud-native applications on Kubernetes.
https://draft.sh
MIT License
3.92k stars 396 forks source link

Should Draft be able to delete any Helm application? #665

Closed radu-matei closed 6 years ago

radu-matei commented 6 years ago

To test:

$ helm install stable/mysql --name mysql
$ draft delete mysql

You will see an error that it didn't find any objects to delete from the ConfigMaps storage, but it will delete the Helm release.

The fix to simply invert the order of those two statements.

    // delete helm release
    _, err = helmClient.DeleteRelease(app, helm.DeletePurge(true))
    if err != nil {
        return errors.New(grpc.ErrorDesc(err))
    }

    // delete Draft storage for app
    store := configmap.NewConfigMaps(client.CoreV1().ConfigMaps(tillerNamespace))
    if _, err := store.DeleteBuilds(context.Background(), app); err != nil {
        return err
    }

Is there anything else that should be taken into consideration?