in pkg/controllers/hub/trafficmanagerprofile/controller.go [226:266]
func equalAzureTrafficManagerProfile(current, desired armtrafficmanager.Profile) bool {
// location and dnsConfig (excluding TTL) is immutable
if current.Properties == nil || current.Properties.MonitorConfig == nil || current.Properties.ProfileStatus == nil || current.Properties.TrafficRoutingMethod == nil || current.Properties.DNSConfig == nil {
return false
}
if current.Properties.MonitorConfig.IntervalInSeconds == nil || current.Properties.MonitorConfig.Path == nil ||
current.Properties.MonitorConfig.Port == nil || current.Properties.MonitorConfig.Protocol == nil ||
current.Properties.MonitorConfig.TimeoutInSeconds == nil || current.Properties.MonitorConfig.ToleratedNumberOfFailures == nil {
return false
}
if *current.Properties.MonitorConfig.IntervalInSeconds != *desired.Properties.MonitorConfig.IntervalInSeconds ||
*current.Properties.MonitorConfig.Path != *desired.Properties.MonitorConfig.Path ||
*current.Properties.MonitorConfig.Port != *desired.Properties.MonitorConfig.Port ||
*current.Properties.MonitorConfig.Protocol != *desired.Properties.MonitorConfig.Protocol ||
*current.Properties.MonitorConfig.TimeoutInSeconds != *desired.Properties.MonitorConfig.TimeoutInSeconds ||
*current.Properties.MonitorConfig.ToleratedNumberOfFailures != *desired.Properties.MonitorConfig.ToleratedNumberOfFailures {
return false
}
if *current.Properties.ProfileStatus != *desired.Properties.ProfileStatus || *current.Properties.TrafficRoutingMethod != *desired.Properties.TrafficRoutingMethod {
return false
}
if current.Properties.DNSConfig.TTL == nil || *current.Properties.DNSConfig.TTL != *desired.Properties.DNSConfig.TTL {
return false
}
if current.Tags == nil {
return false
}
for key, value := range desired.Tags {
currentValue := current.Tags[key]
if (value == nil && currentValue != nil) || (value != nil && currentValue == nil) || (currentValue == nil || *currentValue != *value) {
return false
}
}
return true
}