mirror of https://github.com/kubernetes/kops.git
DNS: Don't try to apply empty changesets
For GCE this was resulting in confusing error messages.
This commit is contained in:
parent
ef5c0de500
commit
520474468d
|
|
@ -302,6 +302,10 @@ func (c *DNSController) runOnce() error {
|
|||
}
|
||||
|
||||
for key, changeset := range op.changesets {
|
||||
if changeset.IsEmpty() {
|
||||
continue
|
||||
}
|
||||
|
||||
klog.V(2).Infof("applying DNS changeset for zone %s", key)
|
||||
if err := changeset.Apply(); err != nil {
|
||||
klog.Warningf("error applying DNS changeset for zone %s: %v", key, err)
|
||||
|
|
|
|||
|
|
@ -50,6 +50,10 @@ func (c *ResourceRecordChangeset) Upsert(rrset dnsprovider.ResourceRecordSet) dn
|
|||
}
|
||||
|
||||
func (c *ResourceRecordChangeset) Apply() error {
|
||||
if c.IsEmpty() {
|
||||
return nil
|
||||
}
|
||||
|
||||
rrsets := c.rrsets
|
||||
|
||||
service := rrsets.zone.zones.interface_.service.Changes()
|
||||
|
|
@ -115,7 +119,7 @@ func (c *ResourceRecordChangeset) Apply() error {
|
|||
}
|
||||
|
||||
func (c *ResourceRecordChangeset) IsEmpty() bool {
|
||||
return len(c.additions) == 0 && len(c.removals) == 0
|
||||
return len(c.additions) == 0 && len(c.removals) == 0 && len(c.upserts) == 0
|
||||
}
|
||||
|
||||
// ResourceRecordSets returns the parent ResourceRecordSets
|
||||
|
|
|
|||
Loading…
Reference in New Issue