Skip to content

Commit 7313212

Browse files
authored
[Bugfix] Allow long resource names (#941)
1 parent a2e4e9b commit 7313212

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

chart/kube-arangodb/templates/_helpers.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Combine name of the deployment.
3232
Create the name of the Operator RBAC role
3333
*/}}
3434
{{- define "kube-arangodb.rbac" -}}
35-
{{- printf "%s-%s" (include "kube-arangodb.operatorName" .) "rbac" | trunc 63 | trimSuffix "-" -}}
35+
{{- printf "%s-%s" (include "kube-arangodb.operatorName" .) "rbac" | trunc 95 | trimSuffix "-" -}}
3636
{{- end -}}
3737

3838
{{/*

pkg/deployment/reconcile/action_remove_member.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ package reconcile
2323
import (
2424
"context"
2525

26-
"github.com/arangodb/go-driver"
2726
"github.com/rs/zerolog"
2827
apiErrors "k8s.io/apimachinery/pkg/api/errors"
2928
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
3029

30+
"github.com/arangodb/go-driver"
3131
api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1"
3232
"github.com/arangodb/kube-arangodb/pkg/util/arangod"
3333
"github.com/arangodb/kube-arangodb/pkg/util/errors"
@@ -84,7 +84,7 @@ func (a *actionRemoveMember) Start(ctx context.Context) (bool, error) {
8484
} else if driver.IsPreconditionFailed(err) {
8585
health := a.actionCtx.GetMembersState().Health()
8686
if health.Error != nil {
87-
return false, errors.WithStack(errors.Wrapf(health.Error, "failed to get cluster health"))
87+
a.log.Err(err).Str("member-id", m.ID).Msgf("Failed get cluster health")
8888
}
8989
// We don't care if not found
9090
if record, ok := health.Members[driver.ServerID(m.ID)]; ok {

pkg/deployment/reconcile/action_wait_for_member_up.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,8 @@ func (a *actionWaitForMemberUp) checkProgressCluster() (bool, bool, error) {
166166
log := a.log
167167
h := a.actionCtx.GetMembersState().Health()
168168
if h.Error != nil {
169-
return false, false, errors.WithStack(errors.Wrapf(h.Error, "failed to get cluster health"))
169+
log.Debug().Err(h.Error).Msg("Cluster health is missing")
170+
return false, false, nil
170171
}
171172
sh, found := h.Members[driver.ServerID(a.action.MemberID)]
172173
if !found {

pkg/deployment/resources/member_cleanup.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ var (
4949

5050
// CleanupRemovedMembers removes all arangod members that are no longer part of ArangoDB deployment.
5151
func (r *Resources) CleanupRemovedMembers(ctx context.Context, health memberState.Health) error {
52+
if health.Error != nil {
53+
r.log.Info().Err(health.Error).Msg("Health of the cluster is missing")
54+
return nil
55+
}
56+
5257
// Decide what to do depending on cluster mode
5358
switch r.context.GetSpec().GetMode() {
5459
case api.DeploymentModeCluster:
@@ -69,11 +74,6 @@ func (r *Resources) CleanupRemovedMembers(ctx context.Context, health memberStat
6974
func (r *Resources) cleanupRemovedClusterMembers(ctx context.Context, health memberState.Health) error {
7075
log := r.log
7176

72-
if health.Error != nil {
73-
log.Info().Err(health.Error).Msg("Health od the cluster is missing")
74-
return nil
75-
}
76-
7777
serverFound := func(id string) bool {
7878
_, found := health.Members[driver.ServerID(id)]
7979
return found

0 commit comments

Comments
 (0)