upgrade: making go routine resilient to conflicts (PROJQUAY-2395)#496
upgrade: making go routine resilient to conflicts (PROJQUAY-2395)#496ricardomaraschini merged 1 commit intoquay:masterfrom ricardomaraschini:version-update-fix
Conversation
The go routine reponsible for updating the current version in status can't fail otherwise we ended up not fully deploying Quay. This commit makes it more resilient to transient failures. This go routine must go away, this is a temporary fix.
| log.Error(err, "could not update QuayRegistry status with current version") | ||
|
|
||
| return true, err | ||
| return false, nil |
There was a problem hiding this comment.
Why is the error not returned anymore, and how will the controller handle that change?
There was a problem hiding this comment.
The idea is to make the go routine resilient to errors by simply logging them instead of returning them. If we return an error the go routine will stop trying and this is what we are trying to avoid. As a side note, this go routine must go away because it is wrong.
| log.Error(err, "could not update QuayRegistry spec to complete upgrade") | ||
|
|
||
| return true, err | ||
| return false, nil |
There was a problem hiding this comment.
Same answer.
|
|
||
| updatedQuay, _ := v1.EnsureRegistryEndpoint(quayContext, updatedQuay, userProvidedConfig) | ||
| var freshQuay v1.QuayRegistry | ||
| if err := r.Client.Get(ctx, req.NamespacedName, &freshQuay); err != nil { |
There was a problem hiding this comment.
What's the reasoning for this extra request first, as opposed to using updatedQuay directly?
There was a problem hiding this comment.
If the version we have in memory is not the current version (the version in the etcd) we will receive a Conflict error. If we don't fetch a fresh version, once we receive a Conflict back, we will always see Conflicts.
backport-fix: (PROJQUAY-2395) (quay#496) Signed-off-by: harishsurf <hgovinda@redhat.com>
backport-fix: (PROJQUAY-2395) (#496) Signed-off-by: harishsurf <hgovinda@redhat.com>
The go routine reponsible for updating the current version in status
can't fail otherwise we ended up not fully deploying Quay.
This commit makes it more resilient to transient failures. This go
routine must go away, this is a temporary fix.