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
8 changes: 8 additions & 0 deletions pkg/apis/deployment/v1/deployment_spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ type DeploymentSpec struct {

RestoreFrom *string `json:"restoreFrom,omitempty"`

// AllowUnsafeUpgrade determines if upgrade on missing member or with not in sync shards is allowed
AllowUnsafeUpgrade *bool `json:"allowUnsafeUpgrade,omitempty"`

ExternalAccess ExternalAccessSpec `json:"externalAccess"`
RocksDB RocksDBSpec `json:"rocksdb"`
Authentication AuthenticationSpec `json:"auth"`
Expand Down Expand Up @@ -270,6 +273,11 @@ func (s *DeploymentSpec) SetDefaultsFrom(source DeploymentSpec) {
if s.DisableIPv6 == nil {
s.DisableIPv6 = util.NewBoolOrNil(source.DisableIPv6)
}

if s.AllowUnsafeUpgrade == nil {
s.AllowUnsafeUpgrade = util.NewBoolOrNil(source.AllowUnsafeUpgrade)
}

s.License.SetDefaultsFrom(source.License)
s.ExternalAccess.SetDefaultsFrom(source.ExternalAccess)
s.RocksDB.SetDefaultsFrom(source.RocksDB)
Expand Down
5 changes: 5 additions & 0 deletions pkg/apis/deployment/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions pkg/deployment/reconcile/plan_builder_rotate_upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
upgraderules "github.com/arangodb/go-upgrade-rules"
"github.com/arangodb/kube-arangodb/pkg/apis/deployment"
api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1"
"github.com/arangodb/kube-arangodb/pkg/util"
"github.com/arangodb/kube-arangodb/pkg/util/k8sutil"
"github.com/rs/zerolog"
core "k8s.io/api/core/v1"
Expand Down Expand Up @@ -105,8 +106,14 @@ func createRotateOrUpgradePlan(log zerolog.Logger, apiObject k8sutil.APIObject,
// Use the new plan
return newPlan, false
} else {
log.Info().Msg("Pod needs upgrade but cluster is not ready. Either some shards are not in sync or some member is not ready.")
return nil, true
if util.BoolOrDefault(spec.AllowUnsafeUpgrade, false) {
log.Info().Msg("Pod needs upgrade but cluster is not ready. Either some shards are not in sync or some member is not ready, but unsafe upgrade is allowed")
// Use the new plan
return newPlan, false
} else {
log.Info().Msg("Pod needs upgrade but cluster is not ready. Either some shards are not in sync or some member is not ready.")
return nil, true
}
}
}
return nil, false
Expand Down