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:
parent
d7edf28c51
commit
b9945fc482
3 changed files with 9 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
## [master](https://github.com/arangodb/kube-arangodb/tree/master) (N/A)
|
## [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)
|
## [1.2.18](https://github.com/arangodb/kube-arangodb/tree/1.2.18) (2022-09-28)
|
||||||
- (Feature) Define Actions PlaceHolder
|
- (Feature) Define Actions PlaceHolder
|
||||||
|
|
|
@ -103,6 +103,7 @@ type Deployment struct {
|
||||||
log logging.Logger
|
log logging.Logger
|
||||||
|
|
||||||
name string
|
name string
|
||||||
|
uid types.UID
|
||||||
namespace string
|
namespace string
|
||||||
|
|
||||||
currentObject *api.ArangoDeployment
|
currentObject *api.ArangoDeployment
|
||||||
|
@ -234,6 +235,7 @@ func New(config Config, deps Dependencies, apiObject *api.ArangoDeployment) (*De
|
||||||
currentObject: apiObject,
|
currentObject: apiObject,
|
||||||
currentObjectStatus: apiObject.Status.DeepCopy(),
|
currentObjectStatus: apiObject.Status.DeepCopy(),
|
||||||
name: apiObject.GetName(),
|
name: apiObject.GetName(),
|
||||||
|
uid: apiObject.GetUID(),
|
||||||
namespace: apiObject.GetNamespace(),
|
namespace: apiObject.GetNamespace(),
|
||||||
config: config,
|
config: config,
|
||||||
deps: deps,
|
deps: deps,
|
||||||
|
|
|
@ -76,6 +76,12 @@ func (d *Deployment) inspectDeployment(lastInterval util.Interval) util.Interval
|
||||||
d.log.Info("Deployment is gone")
|
d.log.Info("Deployment is gone")
|
||||||
d.Stop()
|
d.Stop()
|
||||||
return nextInterval
|
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 {
|
} else if updated != nil && updated.GetDeletionTimestamp() != nil {
|
||||||
// Deployment is marked for deletion
|
// Deployment is marked for deletion
|
||||||
if err := d.runDeploymentFinalizers(ctxReconciliation, d.GetCachedStatus()); err != nil {
|
if err := d.runDeploymentFinalizers(ctxReconciliation, d.GetCachedStatus()); err != nil {
|
||||||
|
|
Loading…
Reference in a new issue