-
Notifications
You must be signed in to change notification settings - Fork 73
[Bugfix] Add Arch Toleration #1961
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
// | ||
// DISCLAIMER | ||
// | ||
// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany | ||
// Copyright 2016-2025 ArangoDB GmbH, Cologne, Germany | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
|
@@ -27,6 +27,7 @@ import ( | |
) | ||
|
||
const ( | ||
TolerationArchitecture = "kubernetes.io/arch" | ||
TolerationKeyNodeNotReady = "node.kubernetes.io/not-ready" | ||
TolerationKeyNodeAlphaUnreachable = "node.alpha.kubernetes.io/unreachable" | ||
TolerationKeyNodeUnreachable = "node.kubernetes.io/unreachable" | ||
|
@@ -44,7 +45,22 @@ func NewNoExecuteToleration(key string, duration TolerationDuration) core.Tolera | |
t := core.Toleration{ | ||
Key: key, | ||
Operator: "Exists", | ||
Effect: "NoExecute", | ||
Effect: core.TaintEffectNoExecute, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change modifies existing behavior by replacing the string literal 'NoExecute' with the constant core.TaintEffectNoExecute. While this is generally a good practice, it should be verified that this doesn't break any existing functionality that might depend on the string comparison. Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||
} | ||
if !duration.Forever { | ||
tolerationSeconds := int64(duration.TimeSpan.Seconds()) | ||
t.TolerationSeconds = &tolerationSeconds | ||
} | ||
return t | ||
} | ||
|
||
// NewNoScheduleToleration is a helper to create a Toleration with | ||
// Key=key, Operator='Exists' Effect='NoSchedule', TolerationSeconds=tolerationDuration.Seconds(). | ||
func NewNoScheduleToleration(key string, duration TolerationDuration) core.Toleration { | ||
t := core.Toleration{ | ||
Key: key, | ||
Operator: "Exists", | ||
Effect: core.TaintEffectNoSchedule, | ||
} | ||
if !duration.Forever { | ||
tolerationSeconds := int64(duration.TimeSpan.Seconds()) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The changelog entry uses 'Arch' as an abbreviation. Consider using the full word 'Architecture' for clarity: '- (Feature) Add Architecture Tolerations'
Copilot uses AI. Check for mistakes.