Skip to content

Commit

Permalink
Fix retry logic in create functions
Browse files Browse the repository at this point in the history
Signed-off-by: Raul Sevilla <rsevilla@redhat.com>
  • Loading branch information
rsevilla87 committed Apr 6, 2021
1 parent b27b00c commit 6d42586
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/burner/create.go
Expand Up @@ -220,14 +220,14 @@ func createRequest(gvr schema.GroupVersionResource, ns string, obj *unstructured
return true, err
} else if errors.IsAlreadyExists(err) {
log.Errorf("%s/%s in namespace %s already exists", obj.GetKind(), obj.GetName(), ns)
return true, err
return true, nil
} else if errors.IsTimeout(err) {
log.Errorf("Timeout creating object %s/%s in namespace %s: %s", obj.GetKind(), obj.GetName(), ns, err)
} else if err != nil {
log.Errorf("Error creating object: %s", err)
}
log.Error("Retrying object creation")
return false, err
return false, nil
}
log.Infof("Created %s/%s in namespace %s", uns.GetKind(), uns.GetName(), ns)
return true, err
Expand Down
2 changes: 1 addition & 1 deletion pkg/burner/namespaces.go
Expand Up @@ -42,7 +42,7 @@ func createNamespace(clientset *kubernetes.Clientset, namespaceName string, nsLa
return true, err
} else if err != nil {
log.Errorf("Unexpected error creating namespace %s: %s", ns.Name, err)
return false, err
return false, nil
}
log.Infof("Created namespace: %s", ns.Name)
return true, err
Expand Down

0 comments on commit 6d42586

Please sign in to comment.