Skip to content

Commit 0d814a7

Browse files
authored
[Feature] Optional Flag propagation (#837)
1 parent f346963 commit 0d814a7

File tree

9 files changed

+41
-9
lines changed

9 files changed

+41
-9
lines changed

pkg/apis/deployment/v1/deployment_metrics_service_monitor_spec.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ func (m *MetricsServiceMonitorSpec) IsEnabled() bool {
3434
}
3535

3636
func (m *MetricsServiceMonitorSpec) GetLabels(def map[string]string) map[string]string {
37+
if m == nil {
38+
return def
39+
}
40+
3741
if len(m.Labels) == 0 {
3842
return def
3943
}

pkg/apis/deployment/v1/deployment_spec.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,9 @@ func (s DeploymentSpec) IsDisableIPv6() bool {
251251
return util.BoolOrDefault(s.DisableIPv6)
252252
}
253253

254-
// IsNetworkAttachedVolumes returns the value of networkAttachedVolumes, default false
254+
// IsNetworkAttachedVolumes returns the value of networkAttachedVolumes, default true
255255
func (s DeploymentSpec) IsNetworkAttachedVolumes() bool {
256-
return util.BoolOrDefault(s.NetworkAttachedVolumes, false)
256+
return util.BoolOrDefault(s.NetworkAttachedVolumes, true)
257257
}
258258

259259
// GetListenAddr returns "[::]" or "0.0.0.0" depending on IsDisableIPv6

pkg/apis/deployment/v1/zz_generated.deepcopy.go

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/apis/deployment/v2alpha1/deployment_metrics_service_monitor_spec.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ func (m *MetricsServiceMonitorSpec) IsEnabled() bool {
3434
}
3535

3636
func (m *MetricsServiceMonitorSpec) GetLabels(def map[string]string) map[string]string {
37+
if m == nil {
38+
return def
39+
}
40+
3741
if len(m.Labels) == 0 {
3842
return def
3943
}

pkg/apis/deployment/v2alpha1/deployment_spec.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,9 @@ func (s DeploymentSpec) IsDisableIPv6() bool {
251251
return util.BoolOrDefault(s.DisableIPv6)
252252
}
253253

254-
// IsNetworkAttachedVolumes returns the value of networkAttachedVolumes, default false
254+
// IsNetworkAttachedVolumes returns the value of networkAttachedVolumes, default true
255255
func (s DeploymentSpec) IsNetworkAttachedVolumes() bool {
256-
return util.BoolOrDefault(s.NetworkAttachedVolumes, false)
256+
return util.BoolOrDefault(s.NetworkAttachedVolumes, true)
257257
}
258258

259259
// GetListenAddr returns "[::]" or "0.0.0.0" depending on IsDisableIPv6

pkg/apis/deployment/v2alpha1/server_group_spec.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,11 @@ type ServerGroupProbesSpec struct {
261261
ReadinessProbeDisabled *bool `json:"readinessProbeDisabled,omitempty"`
262262
// ReadinessProbeSpec override readiness probe configuration
263263
ReadinessProbeSpec *ServerGroupProbeSpec `json:"readinessProbeSpec,omitempty"`
264+
265+
// StartupProbeDisabled if true startupProbes are disabled
266+
StartupProbeDisabled *bool `json:"startupProbeDisabled,omitempty"`
267+
// StartupProbeSpec override startup probe configuration
268+
StartupProbeSpec *ServerGroupProbeSpec `json:"startupProbeSpec,omitempty"`
264269
}
265270

266271
// GetReadinessProbeDisabled returns in proper manner readiness probe flag with backward compatibility.

pkg/apis/deployment/v2alpha1/zz_generated.deepcopy.go

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/deployment/rotation/arangod_containers.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,8 @@ func containersCompare(_ api.DeploymentSpec, _ api.ServerGroup, spec, status *co
6262

6363
if !equality.Semantic.DeepEqual(ac.Env, bc.Env) {
6464
if areEnvsEqual(ac.Env, bc.Env, func(a, b map[string]core.EnvVar) (map[string]core.EnvVar, map[string]core.EnvVar) {
65-
if _, ok := a[topology.ArangoDBZone]; !ok {
66-
delete(b, topology.ArangoDBZone)
67-
}
65+
delete(a, topology.ArangoDBZone)
66+
delete(b, topology.ArangoDBZone)
6867

6968
return a, b
7069
}) {

pkg/deployment/rotation/arangod_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ func Test_ArangoD_Envs_Zone(t *testing.T) {
270270
c.Env = []core.EnvVar{}
271271
})),
272272

273-
expectedMode: GracefulRotation,
273+
expectedMode: SilentRotation,
274274
},
275275
{
276276
name: "Update Zone env",
@@ -293,7 +293,7 @@ func Test_ArangoD_Envs_Zone(t *testing.T) {
293293
}
294294
})),
295295

296-
expectedMode: GracefulRotation,
296+
expectedMode: SilentRotation,
297297
},
298298
{
299299
name: "Update other env",

0 commit comments

Comments
 (0)