MCPcopy Index your code
hub / github.com/cortexlabs/cortex / DeleteAPI

Function DeleteAPI

pkg/operator/resources/trafficsplitter/api.go:87–107  ·  view source on GitHub ↗

DeleteAPI deletes all the resources related to a given traffic splitter API

(apiName string, keepCache bool)

Source from the content-addressed store, hash-verified

85
86// DeleteAPI deletes all the resources related to a given traffic splitter API
87func DeleteAPI(apiName string, keepCache bool) error {
88 err := parallel.RunFirstErr(
89 func() error {
90 return deleteK8sResources(apiName)
91 },
92 func() error {
93 if keepCache {
94 return nil
95 }
96 // best effort deletion
97 _ = deleteS3Resources(apiName)
98 return nil
99 },
100 )
101
102 if err != nil {
103 return err
104 }
105
106 return nil
107}
108
109func applyK8sVirtualService(trafficSplitter *spec.API, prevVirtualService *istioclientnetworking.VirtualService) error {
110 newVirtualService := virtualServiceSpec(trafficSplitter)

Callers 1

DeleteAPIFunction · 0.92

Calls 3

RunFirstErrFunction · 0.92
deleteK8sResourcesFunction · 0.70
deleteS3ResourcesFunction · 0.70

Tested by

no test coverage detected