IsAnnotationSubset checks if a collection of annotations is a subset of another NOTE: there are two parameters for the annotations to check. The `fixed` one is for annotations that certainly should be inherited (`inheritedMetadata` in the spec) The other annotations may or may not be inherited depe
( mapSet, clusterAnnotations, fixedInheritedAnnotations map[string]string, controller InheritanceController, )
| 98 | // is for annotations that certainly should be inherited (`inheritedMetadata` in the spec) |
| 99 | // The other annotations may or may not be inherited depending on the configuration |
| 100 | func IsAnnotationSubset( |
| 101 | mapSet, clusterAnnotations, fixedInheritedAnnotations map[string]string, |
| 102 | controller InheritanceController, |
| 103 | ) bool { |
| 104 | mapToEvaluate := map[string]string{} |
| 105 | |
| 106 | for key, value := range fixedInheritedAnnotations { |
| 107 | mapToEvaluate[key] = value |
| 108 | } |
| 109 | |
| 110 | for key, value := range clusterAnnotations { |
| 111 | if controller.IsAnnotationInherited(key) { |
| 112 | mapToEvaluate[key] = value |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | return IsMapSubset(mapSet, mapToEvaluate) |
| 117 | } |
no test coverage detected