Leader election lease tunables#549
Leader election lease tunables#549openshift-merge-bot[bot] merged 1 commit intoopenstack-k8s-operators:mainfrom
Conversation
dprince
left a comment
There was a problem hiding this comment.
This looks good to me. We'll need to decide on timing and roll out similar changes to all service operators.
main.go
Outdated
| } | ||
| } | ||
|
|
||
| func getEnvInDuration(envName string) time.Duration { |
There was a problem hiding this comment.
maybe we add this to lib-common since we want to do this across operators?
main.go
Outdated
| if leaseDuration := getEnvInDuration("LEASE_DURATION"); leaseDuration != 0 { | ||
| setupLog.Info("manager configured with lease duration", "seconds", int(leaseDuration.Seconds())) | ||
| options.LeaseDuration = &leaseDuration | ||
| } | ||
|
|
||
| if renewDeadline := getEnvInDuration("RENEW_DEADLINE"); renewDeadline != 0 { | ||
| setupLog.Info("manager configured with renew deadline", "seconds", int(renewDeadline.Seconds())) | ||
| options.RenewDeadline = &renewDeadline | ||
| } | ||
|
|
||
| if retryPeriod := getEnvInDuration("RETRY_PERIOD"); retryPeriod != 0 { | ||
| setupLog.Info("manager configured with retry period", "seconds", int(retryPeriod.Seconds())) | ||
| options.RetryPeriod = &retryPeriod | ||
| } |
There was a problem hiding this comment.
just thinking about to get this in sync across the operators, could also do this in lib-common and just pass in a ptr to options ? like if we'd then later add another ENV var, we'd just need to add it to lib-common.
|
This change depends on a change that failed to merge. Change openstack-k8s-operators/lib-common#627 is needed. |
|
This change depends on a change that failed to merge. Change openstack-k8s-operators/lib-common#627 is needed. |
|
/test precommit-check |
Expose the leader election tunables for lease duration, renew deadline and retry period via environment variables. This is inspired by rabbitmq operator exposes the same. Jira: OSPRH-16335 Depends-On: openstack-k8s-operators/lib-common#627
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hjensas, steveb The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
2f6d0b9
into
openstack-k8s-operators:main
Expose the leader election tunables for lease duration, renew deadline and retry period via environment variables.
This is inspired by rabbitmq operator exposes the same.
Jira: OSPRH-16335
Depends-On: openstack-k8s-operators/lib-common#627