From 635ed17f7f5596481098bd751fc156c58eb5ef95 Mon Sep 17 00:00:00 2001 From: jwierzbo Date: Thu, 26 May 2022 12:56:51 +0200 Subject: [PATCH] (Feature) Add `ACSDeploymentSynced` condition type and fix comparison of `SecretHashes` method (#944) --- CHANGELOG.md | 1 + pkg/apis/deployment/v1/secret_hashes.go | 6 +++--- pkg/apis/deployment/v2alpha1/secret_hashes.go | 6 +++--- pkg/deployment/acs/sutil/conditions.go | 1 + 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 869cbb5d0..b6a70d680 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - (Feature) Allow raw json value for license token-v2 - (Update) Replace `beta.kubernetes.io/arch` to `kubernetes.io/arch` in Operator Chart - (Feature) Add operator shutdown handler for graceful termination +- (Feature) Add `ACSDeploymentSynced` condition type and fix comparison of `SecretHashes` method ## [1.2.12](https://github.com/arangodb/kube-arangodb/tree/1.2.12) (2022-05-10) - (Feature) Add CoreV1 Endpoints Inspector diff --git a/pkg/apis/deployment/v1/secret_hashes.go b/pkg/apis/deployment/v1/secret_hashes.go index 5fb6dde35..b30d34038 100644 --- a/pkg/apis/deployment/v1/secret_hashes.go +++ b/pkg/apis/deployment/v1/secret_hashes.go @@ -38,10 +38,10 @@ type SecretHashes struct { // Equal compares two SecretHashes func (sh *SecretHashes) Equal(other *SecretHashes) bool { - if sh == nil || other == nil { - return false - } else if sh == other { + if sh == nil && other == nil { return true + } else if sh == nil || other == nil { + return false } return sh.AuthJWT == other.AuthJWT && diff --git a/pkg/apis/deployment/v2alpha1/secret_hashes.go b/pkg/apis/deployment/v2alpha1/secret_hashes.go index dcdd8b297..5494ab4f4 100644 --- a/pkg/apis/deployment/v2alpha1/secret_hashes.go +++ b/pkg/apis/deployment/v2alpha1/secret_hashes.go @@ -38,10 +38,10 @@ type SecretHashes struct { // Equal compares two SecretHashes func (sh *SecretHashes) Equal(other *SecretHashes) bool { - if sh == nil || other == nil { - return false - } else if sh == other { + if sh == nil && other == nil { return true + } else if sh == nil || other == nil { + return false } return sh.AuthJWT == other.AuthJWT && diff --git a/pkg/deployment/acs/sutil/conditions.go b/pkg/deployment/acs/sutil/conditions.go index 19c44b0dd..97419b278 100644 --- a/pkg/deployment/acs/sutil/conditions.go +++ b/pkg/deployment/acs/sutil/conditions.go @@ -28,4 +28,5 @@ const ( RemoteDeploymentReadyCondition api.ConditionType = "RemoteDeploymentReadyCondition" RemoteCacheReadyCondition api.ConditionType = "RemoteCacheReady" ConnectionReadyCondition api.ConditionType = "ConnectionReady" + ACSDeploymentSyncedCondition api.ConditionType = "ACSDeploymentSynced" )