MCPcopy Index your code
hub / github.com/aws/aws-node-termination-handler / addTaintToSpec

Function addTaintToSpec

pkg/node/node.go:840–857  ·  view source on GitHub ↗
(node *corev1.Node, taintKey string, taintValue string, effect corev1.TaintEffect)

Source from the content-addressed store, hash-verified

838}
839
840func addTaintToSpec(node *corev1.Node, taintKey string, taintValue string, effect corev1.TaintEffect) bool {
841 for _, taint := range node.Spec.Taints {
842 if taint.Key == taintKey {
843 log.Debug().
844 Str("taint_key", taintKey).
845 Interface("taint", taint).
846 Str("node_name", node.Name).
847 Msg("Taint key already present on node")
848 return false
849 }
850 }
851 node.Spec.Taints = append(node.Spec.Taints, corev1.Taint{
852 Key: taintKey,
853 Value: taintValue,
854 Effect: effect,
855 })
856 return true
857}
858
859func removeTaint(node *corev1.Node, client kubernetes.Interface, taintKey string) (bool, error) {
860 retryDeadline := time.Now().Add(maxRetryDeadline)

Callers 1

addTaintFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected