func()

in internal/controller/authproxyworkload_controller.go [276:294]


func (r *AuthProxyWorkloadReconciler) needsAnnotationUpdate(wl workload.Workload, resource *cloudsqlapi.AuthProxyWorkload) bool {
	// This workload is not mutable. Ignore it.
	if _, ok := wl.(workload.WithMutablePodTemplate); !ok {
		return false
	}

	if isRolloutStrategyNone(resource) {
		return false
	}

	k, v := r.updater.PodAnnotation(resource)
	// Check if the correct annotation exists
	an := wl.PodTemplateAnnotations()
	if an != nil && an[k] == v {
		return false
	}

	return true
}