Skip to content

Commit badc27c

Browse files
committed
Logs & comment
1 parent 69a73b2 commit badc27c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/deployment/context_impl.go

+6
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,15 @@ func (d *Deployment) GetStatus() (api.DeploymentStatus, int32) {
8484

8585
// UpdateStatus replaces the status of the deployment with the given status and
8686
// updates the resources in k8s.
87+
// If the given last version does not match the actual last version of the status object,
88+
// an error is returned.
8789
func (d *Deployment) UpdateStatus(status api.DeploymentStatus, lastVersion int32, force ...bool) error {
8890
if !atomic.CompareAndSwapInt32(&d.status.version, lastVersion, lastVersion+1) {
8991
// Status is obsolete
92+
d.deps.Log.Error().
93+
Int32("expected-version", lastVersion).
94+
Int32("actual-version", d.status.version).
95+
Msg("UpdateStatus version conflict error.")
9096
return maskAny(fmt.Errorf("Status conflict error. Expected version %d, got %d", lastVersion, d.status.version))
9197
}
9298
d.status.last = *status.DeepCopy()

0 commit comments

Comments
 (0)