Skip to content

Commit

Permalink
fixup! Update max slow start arg name to include auto pause
Browse files Browse the repository at this point in the history
  • Loading branch information
jennchenn committed Nov 21, 2023
1 parent 345f8b6 commit e63c401
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
18 changes: 9 additions & 9 deletions controllers/datadogagent/component/agent/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ type ExtendedDaemonsetOptions struct {
MaxPodUnavailable string
MaxPodSchedulerFailure string

CanaryDuration time.Duration
CanaryReplicas string
CanaryAutoPauseEnabled bool
CanaryAutoPauseMaxRestarts int32
CanaryAutoFailEnabled bool
CanaryAutoFailMaxRestarts int32
CanaryMaxSlowStartDuration time.Duration
CanaryDuration time.Duration
CanaryReplicas string
CanaryAutoPauseEnabled bool
CanaryAutoPauseMaxRestarts int32
CanaryAutoFailEnabled bool
CanaryAutoFailMaxRestarts int32
CanaryAutoPauseMaxSlowStartDuration time.Duration
}

func defaultEDSSpec(options *ExtendedDaemonsetOptions) edsv1alpha1.ExtendedDaemonSetSpec {
Expand Down Expand Up @@ -102,8 +102,8 @@ func defaultEDSSpec(options *ExtendedDaemonsetOptions) edsv1alpha1.ExtendedDaemo
spec.Strategy.Canary.AutoFail.MaxRestarts = edsv1alpha1.NewInt32(options.CanaryAutoFailMaxRestarts)
}

if options.CanaryMaxSlowStartDuration != 0 {
spec.Strategy.Canary.AutoPause.MaxSlowStartDuration = &metav1.Duration{Duration: options.CanaryMaxSlowStartDuration}
if options.CanaryAutoPauseMaxSlowStartDuration != 0 {
spec.Strategy.Canary.AutoPause.MaxSlowStartDuration = &metav1.Duration{Duration: options.CanaryAutoPauseMaxSlowStartDuration}
}

spec.Strategy.Canary.AutoPause.Enabled = edsv1alpha1.NewBool(options.CanaryAutoPauseEnabled)
Expand Down
20 changes: 10 additions & 10 deletions controllers/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,16 +123,16 @@ func startDatadogAgent(logger logr.Logger, mgr manager.Manager, vInfo *version.I
Recorder: mgr.GetEventRecorderFor(agentControllerName),
Options: datadogagent.ReconcilerOptions{
ExtendedDaemonsetOptions: componentagent.ExtendedDaemonsetOptions{
Enabled: options.SupportExtendedDaemonset.Enabled,
MaxPodUnavailable: options.SupportExtendedDaemonset.MaxPodUnavailable,
MaxPodSchedulerFailure: options.SupportExtendedDaemonset.MaxPodSchedulerFailure,
CanaryDuration: options.SupportExtendedDaemonset.CanaryDuration,
CanaryReplicas: options.SupportExtendedDaemonset.CanaryReplicas,
CanaryAutoPauseEnabled: options.SupportExtendedDaemonset.CanaryAutoPauseEnabled,
CanaryAutoPauseMaxRestarts: int32(options.SupportExtendedDaemonset.CanaryAutoPauseMaxRestarts),
CanaryAutoFailEnabled: options.SupportExtendedDaemonset.CanaryAutoFailEnabled,
CanaryAutoFailMaxRestarts: int32(options.SupportExtendedDaemonset.CanaryAutoFailMaxRestarts),
CanaryMaxSlowStartDuration: options.SupportExtendedDaemonset.CanaryAutoPauseMaxSlowStartDuration,
Enabled: options.SupportExtendedDaemonset.Enabled,
MaxPodUnavailable: options.SupportExtendedDaemonset.MaxPodUnavailable,
MaxPodSchedulerFailure: options.SupportExtendedDaemonset.MaxPodSchedulerFailure,
CanaryDuration: options.SupportExtendedDaemonset.CanaryDuration,
CanaryReplicas: options.SupportExtendedDaemonset.CanaryReplicas,
CanaryAutoPauseEnabled: options.SupportExtendedDaemonset.CanaryAutoPauseEnabled,
CanaryAutoPauseMaxRestarts: int32(options.SupportExtendedDaemonset.CanaryAutoPauseMaxRestarts),
CanaryAutoPauseMaxSlowStartDuration: options.SupportExtendedDaemonset.CanaryAutoPauseMaxSlowStartDuration,
CanaryAutoFailEnabled: options.SupportExtendedDaemonset.CanaryAutoFailEnabled,
CanaryAutoFailMaxRestarts: int32(options.SupportExtendedDaemonset.CanaryAutoFailMaxRestarts),
},
SupportCilium: options.SupportCilium,
OperatorMetricsEnabled: options.OperatorMetricsEnabled,
Expand Down

0 comments on commit e63c401

Please sign in to comment.