Skip to content

Commit

Permalink
Check existence of CM before deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
katyanna committed Oct 19, 2023
1 parent 37c8494 commit cd46a25
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions controller/stack_resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,9 +414,14 @@ func (c *StackSetController) ReconcileStackConfigMap(

if len(existing) >= len(configMaps) {
for templateName := range configMaps {
err := c.deleteConfigMapTemplate(ctx, stack, templateName)
_, err := c.client.CoreV1().ConfigMaps(stack.Namespace).Get(ctx, templateName, metav1.GetOptions{})
if err != nil {
return err
continue
}
err = c.deleteConfigMapTemplate(ctx, stack, templateName)
if err != nil {
c.logger.Error(err)
continue
}
}
return nil
Expand Down

0 comments on commit cd46a25

Please sign in to comment.