1
1
//
2
2
// DISCLAIMER
3
3
//
4
- // Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany
4
+ // Copyright 2016-2025 ArangoDB GmbH, Cologne, Germany
5
5
//
6
6
// Licensed under the Apache License, Version 2.0 (the "License");
7
7
// you may not use this file except in compliance with the License.
@@ -27,6 +27,7 @@ import (
27
27
)
28
28
29
29
const (
30
+ TolerationArchitecture = "kubernetes.io/arch"
30
31
TolerationKeyNodeNotReady = "node.kubernetes.io/not-ready"
31
32
TolerationKeyNodeAlphaUnreachable = "node.alpha.kubernetes.io/unreachable"
32
33
TolerationKeyNodeUnreachable = "node.kubernetes.io/unreachable"
@@ -44,7 +45,22 @@ func NewNoExecuteToleration(key string, duration TolerationDuration) core.Tolera
44
45
t := core.Toleration {
45
46
Key : key ,
46
47
Operator : "Exists" ,
47
- Effect : "NoExecute" ,
48
+ Effect : core .TaintEffectNoExecute ,
49
+ }
50
+ if ! duration .Forever {
51
+ tolerationSeconds := int64 (duration .TimeSpan .Seconds ())
52
+ t .TolerationSeconds = & tolerationSeconds
53
+ }
54
+ return t
55
+ }
56
+
57
+ // NewNoScheduleToleration is a helper to create a Toleration with
58
+ // Key=key, Operator='Exists' Effect='NoSchedule', TolerationSeconds=tolerationDuration.Seconds().
59
+ func NewNoScheduleToleration (key string , duration TolerationDuration ) core.Toleration {
60
+ t := core.Toleration {
61
+ Key : key ,
62
+ Operator : "Exists" ,
63
+ Effect : core .TaintEffectNoSchedule ,
48
64
}
49
65
if ! duration .Forever {
50
66
tolerationSeconds := int64 (duration .TimeSpan .Seconds ())
0 commit comments