Skip to content

Commit

Permalink
chore: set default values for roleProbe (#8648)
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyelei authored Dec 16, 2024
1 parent 81d89da commit 5c291a6
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions pkg/controller/component/rsm_convertor.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,18 @@ func (c *itsRoleProbeConvertor) convert(args ...any) (any, error) {
return nil, nil
}

// set the default values for dual operator mode
timeoutSeconds := synthesizeComp.LifecycleActions.RoleProbe.TimeoutSeconds
periodSeconds := synthesizeComp.LifecycleActions.RoleProbe.PeriodSeconds
if timeoutSeconds == 0 {
timeoutSeconds = 1
}
if periodSeconds == 0 {
periodSeconds = 2
}
itsRoleProbe := &workloads.RoleProbe{
TimeoutSeconds: synthesizeComp.LifecycleActions.RoleProbe.TimeoutSeconds,
PeriodSeconds: synthesizeComp.LifecycleActions.RoleProbe.PeriodSeconds,
TimeoutSeconds: timeoutSeconds,
PeriodSeconds: periodSeconds,
SuccessThreshold: 1,
FailureThreshold: 2,
RoleUpdateMechanism: workloads.DirectAPIServerEventUpdate,
Expand Down

0 comments on commit 5c291a6

Please sign in to comment.