Skip to content

Commit 80c6e01

Browse files
authored
handler: Retry enactment update (#1215)
At some scenarios it takes some retries to update the enactment status if the network is not totally settle. This change add some retries to enactment status update. Signed-off-by: Enrique Llorente <[email protected]>
1 parent c072c22 commit 80c6e01

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pkg/enactmentstatus/status.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,17 @@ import (
3434
)
3535

3636
var (
37-
log = logf.Log.WithName("enactmentstatus")
37+
log = logf.Log.WithName("enactmentstatus")
38+
allErrors = func(error) bool { return true }
3839
)
3940

4041
func Update(cli client.Client, key types.NamespacedName, statusSetter func(*nmstate.NodeNetworkConfigurationEnactmentStatus)) error {
4142
logger := log.WithValues("enactment", key.Name)
42-
return retry.RetryOnConflict(retry.DefaultRetry, func() error {
43+
44+
// Some network configuration can break api server connectivity temporally and that
45+
// prevents the NNCE to final state so is forever at in progress makeing the NNCP also
46+
// forever in progress too, this retry allow to overcome that issue.
47+
return retry.OnError(retry.DefaultRetry, allErrors, func() error {
4348
instance := &nmstatev1beta1.NodeNetworkConfigurationEnactment{}
4449
err := cli.Get(context.TODO(), key, instance)
4550
if err != nil {

0 commit comments

Comments
 (0)