func()

in internal/controller/processor.go [271:307]


func (processor *AppConfigurationProviderProcessor) shouldReconcile(
	existingConfigMap *corev1.ConfigMap,
	existingSecrets map[string]corev1.Secret) bool {

	if processor.Provider.Generation != processor.ReconciliationState.Generation {
		// If the provider is updated, we need to reconcile anyway
		return true
	}

	if annotationChanged(processor.ReconciliationState.Annotations, processor.Provider.Annotations) {
		return true
	}

	if processor.ReconciliationState.ConfigMapResourceVersion == nil ||
		*processor.ReconciliationState.ConfigMapResourceVersion != existingConfigMap.ResourceVersion {
		// If the ConfigMap is removed or updated, we need to reconcile anyway
		return true
	}

	if processor.Provider.Spec.Secret == nil {
		return false
	}

	if len(processor.ReconciliationState.ExistingK8sSecrets) == 0 ||
		len(processor.ReconciliationState.ExistingK8sSecrets) != len(existingSecrets) {
		return true
	}

	for name, secret := range existingSecrets {
		if processor.ReconciliationState.ExistingK8sSecrets[name] != nil &&
			processor.ReconciliationState.ExistingK8sSecrets[name].SecretResourceVersion != secret.ResourceVersion {
			return true
		}
	}

	return false
}