mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
Check for an error before checking for nil.
The error object, if it exists, probably has more specific information to hand to the caller.
This commit is contained in:
parent
a3f09700e5
commit
3659c6ff32
@ -283,12 +283,12 @@ func (s *ServiceController) ensureDnsRecords(clusterName string, cachedService *
|
||||
serviceName := cachedService.lastState.Name
|
||||
namespaceName := cachedService.lastState.Namespace
|
||||
zoneNames, regionName, err := s.getClusterZoneNames(clusterName)
|
||||
if zoneNames == nil {
|
||||
return fmt.Errorf("fail to get cluster zone names")
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if zoneNames == nil {
|
||||
return fmt.Errorf("failed to get cluster zone names")
|
||||
}
|
||||
dnsZoneName, err := s.getFederationDNSZoneName()
|
||||
if err != nil {
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user