MCPcopy
hub / github.com/cortexlabs/cortex / DeleteAPI

Function DeleteAPI

pkg/operator/resources/job/taskapi/api.go:96–114  ·  view source on GitHub ↗

DeleteAPI deletes a task api

(apiName string, keepCache bool)

Source from the content-addressed store, hash-verified

94
95// DeleteAPI deletes a task api
96func DeleteAPI(apiName string, keepCache bool) error {
97 err := parallel.RunFirstErr(
98 func() error {
99 return deleteK8sResources(apiName)
100 },
101 func() error {
102 if keepCache {
103 return nil
104 }
105 return deleteS3Resources(apiName)
106 },
107 )
108
109 if err != nil {
110 return err
111 }
112
113 return nil
114}
115
116func deleteS3Resources(apiName string) error {
117 _ = job.DeleteAllInProgressFilesByAPI(userconfig.TaskAPIKind, apiName) // not useful xml error is thrown, swallow the error

Callers 1

DeleteAPIFunction · 0.92

Calls 3

RunFirstErrFunction · 0.92
deleteK8sResourcesFunction · 0.70
deleteS3ResourcesFunction · 0.70

Tested by

no test coverage detected