-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
move field reported to changed #4222
move field reported to changed #4222
Conversation
Codecov Report
|
c1a42fd
to
a745d28
Compare
@@ -111,7 +114,7 @@ func (d *Deployment) IsStatusCheckComplete() bool { | |||
} | |||
|
|||
func (d *Deployment) ReportSinceLastUpdated() string { | |||
if d.status.reported { | |||
if d.status.reported && !d.status.changed { |
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.
This doesn't seem right as .reported
is only ever changed here and it's always set to true
.
I think you just want to track the last-reported status and the current status, and compare them 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.
@briandealwis This works correctly because, for every new status seen, we create a status with constructor newStatus
.
The .reported
set to false.
See deployment.go L57
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.
Ah ok 👍
} | ||
if d.status.Equal(updated) { | ||
d.status.changed = false | ||
return |
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.
Is this return appropriate here? You still need to check the isErrAndNotRetryable(err)
to possibly set done
?
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.
umm no. the status is already same as previous state. We don't need to perform any checks. The done status should have been set in the last iteration.
@@ -111,7 +114,7 @@ func (d *Deployment) IsStatusCheckComplete() bool { | |||
} | |||
|
|||
func (d *Deployment) ReportSinceLastUpdated() string { | |||
if d.status.reported { | |||
if d.status.reported && !d.status.changed { |
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.
Ah ok 👍
Description
I am working on hooking up pod statuses into skaffold.
With pod statuses now coming in, we need a variable to track if a pod status which is part of deployment is changed to print out deployment and pod statuses together like this.
Repurposing the previous
reported
to indicate if a deployment status was changed because a new pod came status was available or new pod came up.