mirror of
https://github.com/arangodb/kube-arangodb.git
synced 2024-12-14 11:57:37 +00:00
[Feature] Optional Flag propagation (#837)
This commit is contained in:
parent
f346963496
commit
0d814a796e
9 changed files with 41 additions and 9 deletions
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
10
pkg/apis/deployment/v1/zz_generated.deepcopy.go
generated
10
pkg/apis/deployment/v1/zz_generated.deepcopy.go
generated
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}) {
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue