-
Notifications
You must be signed in to change notification settings - Fork 17
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
operator: fix ManagedOSVersionChannel sync #769
Conversation
@@ -367,6 +367,9 @@ func (r *ManagedOSVersionChannelReconciler) createManagedOSVersions(ctx context. | |||
if lastSyncTime, found := version.Annotations[elementalv1.ElementalManagedOSVersionChannelLastSyncAnnotation]; !found || (lastSyncTime != syncTimestamp) { | |||
logger.Info("ManagedOSVersion no longer synced through this channel", "name", version.Name) | |||
patchBase := client.MergeFrom(version.DeepCopy()) | |||
if version.ObjectMeta.Annotations == nil { |
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.
Fixes #767
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.
Nice catch!
@@ -460,6 +463,12 @@ func (r *ManagedOSVersionChannelReconciler) createSyncerPod(ctx context.Context, | |||
return err | |||
} | |||
|
|||
// If we don't update the LastSyncedTime on Pod creation, we will loop |
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.
We need this to avoid reachedNextInterval
at line 181 of this same file to keep being true which would land to a create/delete infinite loop
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.
Looks good!
After the very fist initial sync, all subsequently channel syncs fail. Fixed. fixes: rancher#766 Signed-off-by: Francesco Giudici <[email protected]>
Older resources may not have annotations yet: initialize the field. Fixes: rancher#767 Signed-off-by: Francesco Giudici <[email protected]>
* operator: fix ManagedOSVersionChannel sync After the very fist initial sync, all subsequently channel syncs fail. Fixed. fixes: rancher#766 * operator: don't assume ManagedOSVersion resources have annotations Older resources may not have annotations yet: initialize the field. Fixes: rancher#767 --------- Signed-off-by: Francesco Giudici <[email protected]> (cherry picked from commit 5ccde14)
* operator: fix ManagedOSVersionChannel sync (#769) * operator: fix ManagedOSVersionChannel sync After the very fist initial sync, all subsequently channel syncs fail. Fixed. fixes: #766 * operator: don't assume ManagedOSVersion resources have annotations Older resources may not have annotations yet: initialize the field. Fixes: #767 (cherry picked from commit 5ccde14) * operator: always update managedosversionchannel last sync time (#772) ...also if we have an error on Pod creation. Fixes commit 5ccde14 (cherry picked from commit 7227947) Signed-off-by: Francesco Giudici <[email protected]>
Review the sync in the ManagedOSVersionChannel reconcile loop.
After the very fist initial sync, all subsequently channel syncs fail: fixed.
Fixes: #766
Older resources may not have annotations yet: initialize the field.
Fixes: #767