Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace all if ReplaceAllOnUpdate strategy is set #741

Merged
merged 1 commit into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/v1alpha1/humiocluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const (
HumioClusterUpdateStrategyOnDelete = "OnDelete"
// HumioClusterUpdateStrategyRollingUpdate is the update strategy that will always cause pods to be replaced one at a time
HumioClusterUpdateStrategyRollingUpdate = "RollingUpdate"
// HumioClusterUpdateStrategyReplaceAllOnUpdate is the update strategy that will replace all pods at the same time during an update.
// HumioClusterUpdateStrategyReplaceAllOnUpdate is the update strategy that will replace all pods at the same time during an update of either image or configuration.
HumioClusterUpdateStrategyReplaceAllOnUpdate = "ReplaceAllOnUpdate"
// HumioClusterUpdateStrategyRollingUpdateBestEffort is the update strategy where the operator will evaluate the Humio version change and determine if the
// Humio pods can be updated in a rolling fashion or if they must be replaced at the same time
Expand Down
3 changes: 3 additions & 0 deletions controllers/humiocluster_pod_lifecycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ func NewPodLifecycleState(hnp HumioNodePool, pod corev1.Pod) *podLifecycleState
}

func (p *podLifecycleState) ShouldRollingRestart() bool {
if p.nodePool.GetUpdateStrategy().Type == humiov1alpha1.HumioClusterUpdateStrategyReplaceAllOnUpdate {
return false
}
if p.nodePool.GetUpdateStrategy().Type == humiov1alpha1.HumioClusterUpdateStrategyRollingUpdate {
return true
}
Expand Down
Loading