1
0
Fork 0
mirror of https://github.com/arangodb/kube-arangodb.git synced 2024-12-14 11:57:37 +00:00

[Bugfix] Prevent changes when UID is wrong (#1138)

This commit is contained in:
Adam Janikowski 2022-10-04 16:17:19 +02:00 committed by GitHub
parent d7edf28c51
commit b9945fc482
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 0 deletions

View file

@ -1,6 +1,7 @@
# Change Log
## [master](https://github.com/arangodb/kube-arangodb/tree/master) (N/A)
- (Bugfix) Prevent changes when UID is wrong
## [1.2.18](https://github.com/arangodb/kube-arangodb/tree/1.2.18) (2022-09-28)
- (Feature) Define Actions PlaceHolder

View file

@ -103,6 +103,7 @@ type Deployment struct {
log logging.Logger
name string
uid types.UID
namespace string
currentObject *api.ArangoDeployment
@ -234,6 +235,7 @@ func New(config Config, deps Dependencies, apiObject *api.ArangoDeployment) (*De
currentObject: apiObject,
currentObjectStatus: apiObject.Status.DeepCopy(),
name: apiObject.GetName(),
uid: apiObject.GetUID(),
namespace: apiObject.GetNamespace(),
config: config,
deps: deps,

View file

@ -76,6 +76,12 @@ func (d *Deployment) inspectDeployment(lastInterval util.Interval) util.Interval
d.log.Info("Deployment is gone")
d.Stop()
return nextInterval
} else if err != nil {
d.log.Err(err).Error("Deployment fetch error")
return nextInterval
} else if d.uid != updated.GetUID() {
d.log.Error("Deployment UID Changed!")
return nextInterval
} else if updated != nil && updated.GetDeletionTimestamp() != nil {
// Deployment is marked for deletion
if err := d.runDeploymentFinalizers(ctxReconciliation, d.GetCachedStatus()); err != nil {