-
Notifications
You must be signed in to change notification settings - Fork 73
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
Break PKS Loop #277
Break PKS Loop #277
Conversation
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.
LGTM. Except that I believe one more function can remove the force
argument.
return false | ||
} | ||
|
||
for i := 0; i < len(cl); i++ { |
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.
Might have to ignore the order.
func (c Condition) Equal(other Condition) bool { | ||
return c.Type == other.Type && | ||
c.Status == other.Status && | ||
c.LastUpdateTime.Time.Sub(other.LastUpdateTime.Time).Seconds() < 2 && |
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.
Use a function for time comparison. Also make sure we do not have to take the absolute value.
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.
Add a test to make sure.
ds.Reason == other.Reason && | ||
ds.ServiceName == other.ServiceName && | ||
ds.SyncServiceName == other.SyncServiceName && | ||
reflect.DeepEqual(ds.Images, other.Images) && |
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.
Get rid of DeepEqual altogether round here.
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.
LGTM
Check more carefully if an update is required to prevent update loops on PKS <3