func FilterValues(vs []string, f func(string) bool) []string {
	var vsf []string
	for _, v := range vs {
		if f(v) {
			vsf = append(vsf, v)
		}
	}
	return vsf
}
FilterValues Takes a slice of strings and returns a new slice that is filtered by the passed function
package utils
import (
	"strings"
	corev1 "k8s.io/api/core/v1"
)
type JsonPatchOperation struct {
	Op    string      `json:"op"`
	Path  string      `json:"path"`
	Value interface{} `json:"value,omitempty"`
}
func IsEmptyPatch(b []byte) bool {
	if len(b) == 2 || len(b) == 0 {
		return true
	}
	return false
}
func TargetableLabelsAreDifferent(m1 map[string]string, m2 map[string]string) bool {
	for k, v1 := range m1 {
		if strings.Contains(k, "kube-valet.io") {
			continue
		}
		if v2, ok := m2[k]; !ok || ok && v1 != v2 {
			return true
		}
	}
	for k, v2 := range m2 {
		if strings.Contains(k, "kube-valet.io") {
			continue
		}
		if v1, ok := m1[k]; !ok || ok && v1 != v2 {
			return true
		}
	}
	return false
}
func NodeTargetingHasChanged(oldNode *corev1.Node, newNode *corev1.Node) bool {
	if TargetableLabelsAreDifferent(oldNode.GetLabels(), newNode.GetLabels()) {
		return true
	}
	return false
}