Merge pull request #39991 from justinsb/verbose_changeset_logging

Automatic merge from submit-queue

dnsprovider route53: log changeset details at v(8)

Otherwise it can be hard to know exactly what is changing and whether
the changes could be optimized, or to troubleshoot if someone were
accidentally to have a bug in their calling code.

```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue 2017-02-19 19:07:17 -08:00 committed by GitHub
commit 8631aa2eb2
2 changed files with 14 additions and 0 deletions

View File

@ -27,6 +27,7 @@ go_library(
"//vendor:github.com/aws/aws-sdk-go/aws",
"//vendor:github.com/aws/aws-sdk-go/aws/session",
"//vendor:github.com/aws/aws-sdk-go/service/route53",
"//vendor:github.com/golang/glog",
"//vendor:k8s.io/apimachinery/pkg/util/uuid",
],
)

View File

@ -17,8 +17,12 @@ limitations under the License.
package route53
import (
"bytes"
"fmt"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/route53"
"github.com/golang/glog"
"k8s.io/kubernetes/federation/pkg/dnsprovider"
)
@ -93,6 +97,15 @@ func (c *ResourceRecordChangeset) Apply() error {
return nil
}
if glog.V(8) {
var sb bytes.Buffer
for _, change := range changes {
sb.WriteString(fmt.Sprintf("\t%s %s %s\n", aws.StringValue(change.Action), aws.StringValue(change.ResourceRecordSet.Type), aws.StringValue(change.ResourceRecordSet.Name)))
}
glog.V(8).Infof("Route53 Changeset:\n%s", sb.String())
}
service := c.zone.zones.interface_.service
request := &route53.ChangeResourceRecordSetsInput{