MCPcopy Create free account
hub / github.com/devspace-sh/devspace / Delete

Function Delete

pkg/devspace/deploy/deployer/helm/client.go:77–94  ·  view source on GitHub ↗

Delete deletes the deployment

(ctx devspacecontext.Context, deploymentName string)

Source from the content-addressed store, hash-verified

75
76// Delete deletes the deployment
77func Delete(ctx devspacecontext.Context, deploymentName string) error {
78 deploymentCache, ok := ctx.Config().RemoteCache().GetDeployment(deploymentName)
79 if !ok || deploymentCache.Helm == nil || deploymentCache.Helm.Release == "" || deploymentCache.Helm.ReleaseNamespace == "" {
80 return nil
81 }
82
83 helmClient, err := helm.NewClient(ctx.Log())
84 if err != nil {
85 return errors.Wrap(err, "new helm client")
86 }
87
88 err = helmClient.DeleteRelease(ctx, deploymentCache.Helm.Release, deploymentCache.Helm.ReleaseNamespace)
89 if err != nil {
90 return err
91 }
92
93 return nil
94}

Callers 1

TestDeleteFunction · 0.70

Calls 6

DeleteReleaseMethod · 0.95
NewClientFunction · 0.92
GetDeploymentMethod · 0.65
RemoteCacheMethod · 0.65
ConfigMethod · 0.65
LogMethod · 0.65

Tested by 1

TestDeleteFunction · 0.56