diff --git a/pkg/apis/deployment/v1/deployment_metrics_service_monitor_spec.go b/pkg/apis/deployment/v1/deployment_metrics_service_monitor_spec.go index 10c2e4ba0..ad964766e 100644 --- a/pkg/apis/deployment/v1/deployment_metrics_service_monitor_spec.go +++ b/pkg/apis/deployment/v1/deployment_metrics_service_monitor_spec.go @@ -34,6 +34,10 @@ func (m *MetricsServiceMonitorSpec) IsEnabled() bool { } func (m *MetricsServiceMonitorSpec) GetLabels(def map[string]string) map[string]string { + if m == nil { + return def + } + if len(m.Labels) == 0 { return def } diff --git a/pkg/apis/deployment/v1/deployment_spec.go b/pkg/apis/deployment/v1/deployment_spec.go index 1636c9146..ab57da1f8 100644 --- a/pkg/apis/deployment/v1/deployment_spec.go +++ b/pkg/apis/deployment/v1/deployment_spec.go @@ -251,9 +251,9 @@ func (s DeploymentSpec) IsDisableIPv6() bool { return util.BoolOrDefault(s.DisableIPv6) } -// IsNetworkAttachedVolumes returns the value of networkAttachedVolumes, default false +// IsNetworkAttachedVolumes returns the value of networkAttachedVolumes, default true func (s DeploymentSpec) IsNetworkAttachedVolumes() bool { - return util.BoolOrDefault(s.NetworkAttachedVolumes, false) + return util.BoolOrDefault(s.NetworkAttachedVolumes, true) } // GetListenAddr returns "[::]" or "0.0.0.0" depending on IsDisableIPv6 diff --git a/pkg/apis/deployment/v1/zz_generated.deepcopy.go b/pkg/apis/deployment/v1/zz_generated.deepcopy.go index 043e115db..9034535ca 100644 --- a/pkg/apis/deployment/v1/zz_generated.deepcopy.go +++ b/pkg/apis/deployment/v1/zz_generated.deepcopy.go @@ -1571,6 +1571,16 @@ func (in *ServerGroupProbesSpec) DeepCopyInto(out *ServerGroupProbesSpec) { *out = new(ServerGroupProbeSpec) (*in).DeepCopyInto(*out) } + if in.StartupProbeDisabled != nil { + in, out := &in.StartupProbeDisabled, &out.StartupProbeDisabled + *out = new(bool) + **out = **in + } + if in.StartupProbeSpec != nil { + in, out := &in.StartupProbeSpec, &out.StartupProbeSpec + *out = new(ServerGroupProbeSpec) + (*in).DeepCopyInto(*out) + } return } diff --git a/pkg/apis/deployment/v2alpha1/deployment_metrics_service_monitor_spec.go b/pkg/apis/deployment/v2alpha1/deployment_metrics_service_monitor_spec.go index 4a2874f2e..faebf0304 100644 --- a/pkg/apis/deployment/v2alpha1/deployment_metrics_service_monitor_spec.go +++ b/pkg/apis/deployment/v2alpha1/deployment_metrics_service_monitor_spec.go @@ -34,6 +34,10 @@ func (m *MetricsServiceMonitorSpec) IsEnabled() bool { } func (m *MetricsServiceMonitorSpec) GetLabels(def map[string]string) map[string]string { + if m == nil { + return def + } + if len(m.Labels) == 0 { return def } diff --git a/pkg/apis/deployment/v2alpha1/deployment_spec.go b/pkg/apis/deployment/v2alpha1/deployment_spec.go index 7aad780e6..53a7aa0ad 100644 --- a/pkg/apis/deployment/v2alpha1/deployment_spec.go +++ b/pkg/apis/deployment/v2alpha1/deployment_spec.go @@ -251,9 +251,9 @@ func (s DeploymentSpec) IsDisableIPv6() bool { return util.BoolOrDefault(s.DisableIPv6) } -// IsNetworkAttachedVolumes returns the value of networkAttachedVolumes, default false +// IsNetworkAttachedVolumes returns the value of networkAttachedVolumes, default true func (s DeploymentSpec) IsNetworkAttachedVolumes() bool { - return util.BoolOrDefault(s.NetworkAttachedVolumes, false) + return util.BoolOrDefault(s.NetworkAttachedVolumes, true) } // GetListenAddr returns "[::]" or "0.0.0.0" depending on IsDisableIPv6 diff --git a/pkg/apis/deployment/v2alpha1/server_group_spec.go b/pkg/apis/deployment/v2alpha1/server_group_spec.go index fb18be22a..b22e6f993 100644 --- a/pkg/apis/deployment/v2alpha1/server_group_spec.go +++ b/pkg/apis/deployment/v2alpha1/server_group_spec.go @@ -261,6 +261,11 @@ type ServerGroupProbesSpec struct { ReadinessProbeDisabled *bool `json:"readinessProbeDisabled,omitempty"` // ReadinessProbeSpec override readiness probe configuration ReadinessProbeSpec *ServerGroupProbeSpec `json:"readinessProbeSpec,omitempty"` + + // StartupProbeDisabled if true startupProbes are disabled + StartupProbeDisabled *bool `json:"startupProbeDisabled,omitempty"` + // StartupProbeSpec override startup probe configuration + StartupProbeSpec *ServerGroupProbeSpec `json:"startupProbeSpec,omitempty"` } // GetReadinessProbeDisabled returns in proper manner readiness probe flag with backward compatibility. diff --git a/pkg/apis/deployment/v2alpha1/zz_generated.deepcopy.go b/pkg/apis/deployment/v2alpha1/zz_generated.deepcopy.go index dce7902a2..3c172f0cf 100644 --- a/pkg/apis/deployment/v2alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/deployment/v2alpha1/zz_generated.deepcopy.go @@ -1571,6 +1571,16 @@ func (in *ServerGroupProbesSpec) DeepCopyInto(out *ServerGroupProbesSpec) { *out = new(ServerGroupProbeSpec) (*in).DeepCopyInto(*out) } + if in.StartupProbeDisabled != nil { + in, out := &in.StartupProbeDisabled, &out.StartupProbeDisabled + *out = new(bool) + **out = **in + } + if in.StartupProbeSpec != nil { + in, out := &in.StartupProbeSpec, &out.StartupProbeSpec + *out = new(ServerGroupProbeSpec) + (*in).DeepCopyInto(*out) + } return } diff --git a/pkg/deployment/rotation/arangod_containers.go b/pkg/deployment/rotation/arangod_containers.go index 1991a2341..1bb05ba6e 100644 --- a/pkg/deployment/rotation/arangod_containers.go +++ b/pkg/deployment/rotation/arangod_containers.go @@ -62,9 +62,8 @@ func containersCompare(_ api.DeploymentSpec, _ api.ServerGroup, spec, status *co if !equality.Semantic.DeepEqual(ac.Env, bc.Env) { if areEnvsEqual(ac.Env, bc.Env, func(a, b map[string]core.EnvVar) (map[string]core.EnvVar, map[string]core.EnvVar) { - if _, ok := a[topology.ArangoDBZone]; !ok { - delete(b, topology.ArangoDBZone) - } + delete(a, topology.ArangoDBZone) + delete(b, topology.ArangoDBZone) return a, b }) { diff --git a/pkg/deployment/rotation/arangod_test.go b/pkg/deployment/rotation/arangod_test.go index e63ba69a8..a08851dd6 100644 --- a/pkg/deployment/rotation/arangod_test.go +++ b/pkg/deployment/rotation/arangod_test.go @@ -270,7 +270,7 @@ func Test_ArangoD_Envs_Zone(t *testing.T) { c.Env = []core.EnvVar{} })), - expectedMode: GracefulRotation, + expectedMode: SilentRotation, }, { name: "Update Zone env", @@ -293,7 +293,7 @@ func Test_ArangoD_Envs_Zone(t *testing.T) { } })), - expectedMode: GracefulRotation, + expectedMode: SilentRotation, }, { name: "Update other env",