-
Notifications
You must be signed in to change notification settings - Fork 277
OCPBUGS-62144: Makes sure rendering for egress IP reachabilityTimeout triggers restart of ovnkube (node/control) pods #2955
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -501,10 +501,17 @@ func renderOVNKubernetes(conf *operv1.NetworkSpec, bootstrapResult *bootstrap.Bo | |
| } | ||
| data.Data["OVNKubeConfigHash"] = hex.EncodeToString(h.Sum(nil)) | ||
|
|
||
| var reachabilityTimeoutStr string | ||
| if timeout, ok := data.Data["ReachabilityTotalTimeoutSeconds"].(*uint32); ok && timeout != nil { | ||
| reachabilityTimeoutStr = strconv.FormatUint(uint64(*timeout), 10) | ||
| } | ||
|
|
||
| // Compute a separate hash for no-overlay node config (outboundSNAT). | ||
| // This allows ovnkube-node to restart when outboundSNAT changes | ||
| nodeNoOverlayHash := sha1.New() | ||
| nodeNoOverlayHashData := fmt.Sprintf("outboundSNAT=%v", data.Data["NoOverlayOutboundSNAT"]) | ||
| nodeNoOverlayHashData := fmt.Sprintf("outboundSNAT=%v,reachabilityTimeout=%s", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will only help in having a new hash data when timeout value changes or get updated. Based on that it will also redeploy ovnkube-node PODs as the hash added to the annotation of the daemonset would get updated. |
||
| data.Data["NoOverlayOutboundSNAT"], | ||
| reachabilityTimeoutStr) | ||
| if _, err := nodeNoOverlayHash.Write([]byte(nodeNoOverlayHashData)); err != nil { | ||
| return nil, progressing, errors.Wrap(err, "failed to hash node no-overlay config") | ||
| } | ||
|
|
@@ -514,9 +521,10 @@ func renderOVNKubernetes(conf *operv1.NetworkSpec, bootstrapResult *bootstrap.Bo | |
| // This allows ovnkube-control-plane to restart when bgpManagedConfig changes, | ||
| // without restarting ovnkube-node pods. | ||
| cpHash := sha1.New() | ||
| cpHashData := fmt.Sprintf("asNumber=%v,topology=%v", | ||
| cpHashData := fmt.Sprintf("asNumber=%v,topology=%v,reachabilityTimeout=%s", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Above comment applies here as well. This only gonna make sure that the new hash value get updated at the ovnkube-control-plane deployment. But ovnkube application is not gonna be abe to decode. |
||
| data.Data["NoOverlayManagedASNumber"], | ||
| data.Data["NoOverlayManagedTopology"]) | ||
| data.Data["NoOverlayManagedTopology"], | ||
| reachabilityTimeoutStr) | ||
| if _, err := cpHash.Write([]byte(cpHashData)); err != nil { | ||
| return nil, progressing, errors.Wrap(err, "failed to hash control-plane config") | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure hash is consistent when values do not change.