detect_instance_changes

Function detect_instance_changes 

Source
pub fn detect_instance_changes(
    namespace: &str,
    name: &str,
    watch_instances: Option<&Vec<InstanceReference>>,
    current_instances: &[InstanceReference],
) -> bool
Expand description

Detect if the instance list changed between watch event and re-fetch.

This is critical for detecting when:

  1. New instances are added to status.bind9Instances (via bind9InstancesFrom selectors)
  2. Instance lastReconciledAt timestamps are cleared (e.g., instance deleted, needs reconfiguration)

NOTE: InstanceReference PartialEq ignores lastReconciledAt, so we must check timestamps separately!

§Arguments

  • namespace - Namespace for logging
  • name - Zone name for logging
  • watch_instances - Instances from the watch event that triggered reconciliation
  • current_instances - Instances after re-fetching (current state)

§Returns

true if instances changed (list or timestamps), false otherwise