HasLabels verifies that the labels of a cluster contain a specified labels map
( cluster *apiv1.Cluster, labels map[string]string, )
| 93 | // HasLabels verifies that the labels of a cluster contain a specified |
| 94 | // labels map |
| 95 | func HasLabels( |
| 96 | cluster *apiv1.Cluster, |
| 97 | labels map[string]string, |
| 98 | ) bool { |
| 99 | clusterLabels := cluster.Labels |
| 100 | for k, v := range labels { |
| 101 | val, ok := clusterLabels[k] |
| 102 | if !ok || (v != val) { |
| 103 | return false |
| 104 | } |
| 105 | } |
| 106 | return true |
| 107 | } |
| 108 | |
| 109 | // HasAnnotations verifies that the annotations of a cluster contain a specified |
| 110 | // annotations map |
no outgoing calls
no test coverage detected