func()

in pkg/azure/nodetaint_utils.go [26:41]


func (az *azClient) AddTaints(ctx context.Context, req ctrl.Request) {
	node := &corev1.Node{}
	if err := az.client.Get(ctx, req.NamespacedName, node); err != nil {
		klog.Error(err, "unable to fetch Node")
	}
	if !CheckIfTaintExists(node) {
		patch := client.MergeFrom(node.DeepCopy())
		node.Spec.Taints = append(node.Spec.Taints, taint)
		err := az.client.Patch(ctx, node, patch)
		if err == nil {
			klog.Info("Taints added on node: ", node.Name)
		} else {
			klog.Info("Error adding the taints", err)
		}
	}
}