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

Bug 1917537: Fix time comparison in CSV reconcile loop #1974

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/controller/operators/olm/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,7 @@ func (a *Operator) syncClusterServiceVersion(obj interface{}) (syncError error)
}

// status changed, update CSV
if !(outCSV.Status.LastUpdateTime == clusterServiceVersion.Status.LastUpdateTime &&
if !(outCSV.Status.LastUpdateTime.Equal(clusterServiceVersion.Status.LastUpdateTime) &&
exdx marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot that this could be a nil dereference if outCSV.Status.LastUpdateTime == nil. Going to add a check for that first.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, never mind. I keep forgetting a method is orthogonal to the underlying data and LastUpdateTime.Equal() is fine even if LastUpdateTime == nil.

outCSV.Status.Phase == clusterServiceVersion.Status.Phase &&
outCSV.Status.Reason == clusterServiceVersion.Status.Reason &&
outCSV.Status.Message == clusterServiceVersion.Status.Message) {
Expand Down