Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion chart/kube-arangodb/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Combine name of the deployment.
Create the name of the Operator RBAC role
*/}}
{{- define "kube-arangodb.rbac" -}}
{{- printf "%s-%s" (include "kube-arangodb.operatorName" .) "rbac" | trunc 63 | trimSuffix "-" -}}
{{- printf "%s-%s" (include "kube-arangodb.operatorName" .) "rbac" | trunc 95 | trimSuffix "-" -}}
{{- end -}}

{{/*
Expand Down
4 changes: 2 additions & 2 deletions pkg/deployment/reconcile/action_remove_member.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ package reconcile
import (
"context"

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

"github.com/arangodb/go-driver"
api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1"
"github.com/arangodb/kube-arangodb/pkg/util/arangod"
"github.com/arangodb/kube-arangodb/pkg/util/errors"
Expand Down Expand Up @@ -84,7 +84,7 @@ func (a *actionRemoveMember) Start(ctx context.Context) (bool, error) {
} else if driver.IsPreconditionFailed(err) {
health := a.actionCtx.GetMembersState().Health()
if health.Error != nil {
return false, errors.WithStack(errors.Wrapf(health.Error, "failed to get cluster health"))
a.log.Err(err).Str("member-id", m.ID).Msgf("Failed get cluster health")
}
// We don't care if not found
if record, ok := health.Members[driver.ServerID(m.ID)]; ok {
Expand Down
3 changes: 2 additions & 1 deletion pkg/deployment/reconcile/action_wait_for_member_up.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ func (a *actionWaitForMemberUp) checkProgressCluster() (bool, bool, error) {
log := a.log
h := a.actionCtx.GetMembersState().Health()
if h.Error != nil {
return false, false, errors.WithStack(errors.Wrapf(h.Error, "failed to get cluster health"))
log.Debug().Err(h.Error).Msg("Cluster health is missing")
return false, false, nil
}
sh, found := h.Members[driver.ServerID(a.action.MemberID)]
if !found {
Expand Down
10 changes: 5 additions & 5 deletions pkg/deployment/resources/member_cleanup.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ var (

// CleanupRemovedMembers removes all arangod members that are no longer part of ArangoDB deployment.
func (r *Resources) CleanupRemovedMembers(ctx context.Context, health memberState.Health) error {
if health.Error != nil {
r.log.Info().Err(health.Error).Msg("Health of the cluster is missing")
return nil
}

// Decide what to do depending on cluster mode
switch r.context.GetSpec().GetMode() {
case api.DeploymentModeCluster:
Expand All @@ -69,11 +74,6 @@ func (r *Resources) CleanupRemovedMembers(ctx context.Context, health memberStat
func (r *Resources) cleanupRemovedClusterMembers(ctx context.Context, health memberState.Health) error {
log := r.log

if health.Error != nil {
log.Info().Err(health.Error).Msg("Health od the cluster is missing")
return nil
}

serverFound := func(id string) bool {
_, found := health.Members[driver.ServerID(id)]
return found
Expand Down