Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.14] handler: Retry nncp status updated on error #536

Open
wants to merge 1 commit into
base: release-4.14
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions pkg/policyconditions/conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ import (
)

var (
log = logf.Log.WithName("policyconditions")
log = logf.Log.WithName("policyconditions")
allErrors = func(error) bool { return true }
)

type policyConditionStatus struct {
Expand Down Expand Up @@ -172,8 +173,9 @@ func update(apiWriter client.Client, apiReader client.Reader, policyReader clien
logger := log.WithValues("policy", policyKey.Name)
// On conflict we need to re-retrieve enactments since the
// conflict can denote that the calculated policy conditions
// are now not accurate.
return retry.RetryOnConflict(retry.DefaultRetry, func() error {
// are now not accurate, also at node restart we have to retry en error
// related to certificates until nmstate-webhook pod settles.
return retry.OnError(retry.DefaultRetry, allErrors, func() error {
policy := &nmstatev1.NodeNetworkConfigurationPolicy{}
if err := policyReader.Get(context.TODO(), policyKey, policy); err != nil {
return errors.Wrap(err, "getting policy failed")
Expand Down