MCPcopy Index your code
hub / github.com/zalando/postgres-operator / deleteStreams

Method deleteStreams

pkg/cluster/streams.go:61–82  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

59}
60
61func (c *Cluster) deleteStreams() error {
62 // check if stream CRD is installed before trying a delete
63 _, err := c.KubeClient.CustomResourceDefinitions().Get(context.TODO(), constants.EventStreamCRDName, metav1.GetOptions{})
64 if k8sutil.ResourceNotFound(err) {
65 return nil
66 }
67 c.setProcessName("deleting event streams")
68 errors := make([]string, 0)
69
70 for appId := range c.Streams {
71 err := c.deleteStream(appId)
72 if err != nil {
73 errors = append(errors, fmt.Sprintf("%v", err))
74 }
75 }
76
77 if len(errors) > 0 {
78 return fmt.Errorf("could not delete all event stream custom resources: %v", strings.Join(errors, `', '`))
79 }
80
81 return nil
82}
83
84func getDistinctApplicationIds(streams []acidv1.Stream) []string {
85 appIds := make([]string, 0)

Callers 2

DeleteMethod · 0.95
TestDeleteStreamsFunction · 0.80

Calls 5

setProcessNameMethod · 0.95
deleteStreamMethod · 0.95
ResourceNotFoundFunction · 0.92
GetMethod · 0.65

Tested by 1

TestDeleteStreamsFunction · 0.64