fix deletion of event streams
This commit is contained in:
parent
a081173f26
commit
26c882f0fa
|
|
@ -45,9 +45,18 @@ func (c *Cluster) deleteStreams() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
err = c.KubeClient.FabricEventStreams(c.Namespace).Delete(context.TODO(), c.Name, metav1.DeleteOptions{})
|
errors := make([]string, 0)
|
||||||
if err != nil {
|
appIds := gatherApplicationIds(c.Spec.Streams)
|
||||||
return fmt.Errorf("could not delete event stream custom resource: %v", err)
|
for _, appId := range appIds {
|
||||||
|
fesName := fmt.Sprintf("%s-%s", c.Name, appId)
|
||||||
|
err = c.KubeClient.FabricEventStreams(c.Namespace).Delete(context.TODO(), fesName, metav1.DeleteOptions{})
|
||||||
|
if err != nil {
|
||||||
|
errors = append(errors, fmt.Sprintf("could not delete event stream %q: %v", fesName, err))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(errors) > 0 {
|
||||||
|
return fmt.Errorf("could not delete all event stream custom resources: %v", strings.Join(errors, `', '`))
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue