last-applied-config annotation no longer mirrored to endpoint slices

Handles incorrect mirroring of endpoint annotations to created endpoint
slices, specifically the last-applied-config. Also updates tests
and adds test cases for the same
This commit is contained in:
Dakshraj Sharma
2021-06-09 18:55:48 +05:30
parent 8eef6438e6
commit 211485c23d
3 changed files with 137 additions and 5 deletions

View File

@@ -87,9 +87,9 @@ func newEndpointSlice(endpoints *corev1.Endpoints, ports []discovery.EndpointPor
epSlice.Labels[discovery.LabelServiceName] = endpoints.Name
epSlice.Labels[discovery.LabelManagedBy] = controllerName
// clone all annotations but EndpointsLastChangeTriggerTime
// clone all annotations but EndpointsLastChangeTriggerTime and LastAppliedConfigAnnotation
for annotation, val := range endpoints.Annotations {
if annotation == corev1.EndpointsLastChangeTriggerTime {
if annotation == corev1.EndpointsLastChangeTriggerTime || annotation == corev1.LastAppliedConfigAnnotation {
continue
}
epSlice.Annotations[annotation] = val