diff --git a/dns-controller/cmd/dns-controller/main.go b/dns-controller/cmd/dns-controller/main.go index a60be447ed205..49caa4403d338 100644 --- a/dns-controller/cmd/dns-controller/main.go +++ b/dns-controller/cmd/dns-controller/main.go @@ -181,7 +181,7 @@ func main() { // initializeWatchers is responsible for creating the watchers func initializeWatchers(client kubernetes.Interface, dnsctl *dns.DNSController, namespace string, watchIngress bool) error { - glog.V(1).Info("initializing the watch controllers, namespace: %q", namespace) + glog.V(1).Infof("initializing the watch controllers, namespace: %q", namespace) nodeController, err := watchers.NewNodeController(client, dnsctl) if err != nil { diff --git a/dns-controller/pkg/dns/dnscontroller.go b/dns-controller/pkg/dns/dnscontroller.go index 96ba1fca7bedb..1246272c3a14e 100644 --- a/dns-controller/pkg/dns/dnscontroller.go +++ b/dns-controller/pkg/dns/dnscontroller.go @@ -600,7 +600,7 @@ func (s *DNSControllerScope) Replace(recordName string, records []Record) { delete(s.Records, recordName) } else { if recordsSliceEquals(existing, records) { - glog.V(6).Infof("skipping spurious update of record %s/%s=%s", s.ScopeName, recordName, records) + glog.V(6).Infof("skipping spurious update of record %s/%s=%+v", s.ScopeName, recordName, records) return } diff --git a/pkg/acls/s3/storage.go b/pkg/acls/s3/storage.go index f86984e244007..62883199e0502 100644 --- a/pkg/acls/s3/storage.go +++ b/pkg/acls/s3/storage.go @@ -59,7 +59,7 @@ func (s *s3PublicAclStrategy) GetACL(p vfs.Path, cluster *kops.Cluster) (vfs.ACL // We are checking that the file repository url is in S3 _, err = vfs.VFSPath(fileRepository) if err != nil { - glog.V(8).Infof("path %q is not inside of a s3 bucket", u.String) + glog.V(8).Infof("path %q is not inside of a s3 bucket", u.String()) return nil, nil } diff --git a/pkg/apis/kops/validation/validation_test.go b/pkg/apis/kops/validation/validation_test.go index 24c264ee824d6..83dafb04ed2d9 100644 --- a/pkg/apis/kops/validation/validation_test.go +++ b/pkg/apis/kops/validation/validation_test.go @@ -196,7 +196,7 @@ func Test_Validate_DockerConfig_Storage(t *testing.T) { config := &kops.DockerConfig{Storage: &name} errs := ValidateDockerConfig(config, field.NewPath("docker")) if len(errs) != 1 { - t.Fatalf("Expected errors validating DockerConfig %q", config) + t.Fatalf("Expected errors validating DockerConfig %+v", config) } if errs[0].Field != "docker.storage" || errs[0].Type != field.ErrorTypeNotSupported { t.Fatalf("Not the expected error validating DockerConfig %q", errs) diff --git a/pkg/kubemanifest/visitor.go b/pkg/kubemanifest/visitor.go index 94de412461ba8..cee4cf8a5851d 100644 --- a/pkg/kubemanifest/visitor.go +++ b/pkg/kubemanifest/visitor.go @@ -32,12 +32,12 @@ func (m *visitorBase) VisitString(path []string, v string, mutator func(string)) } func (m *visitorBase) VisitBool(path []string, v bool, mutator func(bool)) error { - glog.V(10).Infof("string value at %s: %s", strings.Join(path, "."), v) + glog.V(10).Infof("string value at %s: %v", strings.Join(path, "."), v) return nil } func (m *visitorBase) VisitFloat64(path []string, v float64, mutator func(float64)) error { - glog.V(10).Infof("float64 value at %s: %s", strings.Join(path, "."), v) + glog.V(10).Infof("float64 value at %s: %f", strings.Join(path, "."), v) return nil } diff --git a/pkg/resources/aws/aws.go b/pkg/resources/aws/aws.go index 043f580db8c41..4a7e4aeb451bd 100644 --- a/pkg/resources/aws/aws.go +++ b/pkg/resources/aws/aws.go @@ -1303,14 +1303,14 @@ func extractClusterName(userData string) string { line = strings.TrimSpace(line) line = strings.Trim(line, "'\"") if clusterName != "" && clusterName != line { - glog.Warning("cannot uniquely determine cluster-name, found %q and %q", line, clusterName) + glog.Warningf("cannot uniquely determine cluster-name, found %q and %q", line, clusterName) return "" } clusterName = line } if err := scanner.Err(); err != nil { - glog.Warning("error scanning UserData: %v", err) + glog.Warningf("error scanning UserData: %v", err) return "" } diff --git a/upup/pkg/fi/cloudup/alitasks/disk.go b/upup/pkg/fi/cloudup/alitasks/disk.go index 23565f15448e5..399d73dfee63e 100644 --- a/upup/pkg/fi/cloudup/alitasks/disk.go +++ b/upup/pkg/fi/cloudup/alitasks/disk.go @@ -73,7 +73,7 @@ func (d *Disk) Find(c *fi.Context) (*Disk, error) { return nil, nil } if len(responseDisks) > 1 { - glog.V(4).Info("The number of specified disk with the same name and ClusterTags exceeds 1, diskName:%q", *d.Name) + glog.V(4).Infof("The number of specified disk with the same name and ClusterTags exceeds 1, diskName:%q", *d.Name) } glog.V(2).Infof("found matching Disk with name: %q", *d.Name) @@ -88,7 +88,7 @@ func (d *Disk) Find(c *fi.Context) (*Disk, error) { tags, err := cloud.GetTags(fi.StringValue(actual.DiskId), DiskResource) if err != nil { - glog.V(4).Info("Error getting tags on resourceId:%q", *actual.DiskId) + glog.V(4).Infof("Error getting tags on resourceId:%q", *actual.DiskId) } actual.Tags = tags diff --git a/upup/pkg/fi/cloudup/alitasks/launchconfiguration.go b/upup/pkg/fi/cloudup/alitasks/launchconfiguration.go index 6ac792a37434b..aef675a8c90aa 100644 --- a/upup/pkg/fi/cloudup/alitasks/launchconfiguration.go +++ b/upup/pkg/fi/cloudup/alitasks/launchconfiguration.go @@ -86,7 +86,7 @@ func (l *LaunchConfiguration) Find(c *fi.Context) (*LaunchConfiguration, error) return nil, nil } if len(configList) > 1 { - glog.V(4).Info("The number of specified ScalingConfigurations with the same name and ScalingGroupId exceeds 1, diskName:%q", *l.Name) + glog.V(4).Infof("The number of specified ScalingConfigurations with the same name and ScalingGroupId exceeds 1, diskName:%q", *l.Name) } glog.V(2).Infof("found matching LaunchConfiguration: %q", *l.Name) diff --git a/upup/pkg/fi/cloudup/alitasks/loadbalancer.go b/upup/pkg/fi/cloudup/alitasks/loadbalancer.go index 218d4ad0103ab..b3ac7fe5e6b37 100644 --- a/upup/pkg/fi/cloudup/alitasks/loadbalancer.go +++ b/upup/pkg/fi/cloudup/alitasks/loadbalancer.go @@ -68,7 +68,7 @@ func (l *LoadBalancer) Find(c *fi.Context) (*LoadBalancer, error) { return nil, nil } if len(responseLoadBalancers) > 1 { - glog.V(4).Info("The number of specified loadbalancer with the same name exceeds 1, loadbalancerName:%q", *l.Name) + glog.V(4).Infof("The number of specified loadbalancer with the same name exceeds 1, loadbalancerName:%q", *l.Name) } glog.V(2).Infof("found matching LoadBalancer: %q", *l.Name) @@ -122,7 +122,7 @@ func (l *LoadBalancer) FindIPAddress(context *fi.Context) (*string, error) { return nil, nil } if len(responseLoadBalancers) > 1 { - glog.V(4).Info("The number of specified loadbalancer with the same name exceeds 1, loadbalancerName:%q", *l.Name) + glog.V(4).Infof("The number of specified loadbalancer with the same name exceeds 1, loadbalancerName:%q", *l.Name) } address := responseLoadBalancers[0].Address diff --git a/upup/pkg/fi/cloudup/alitasks/scalinggroup.go b/upup/pkg/fi/cloudup/alitasks/scalinggroup.go index 5641bbb9af6c5..828c9f933b49d 100644 --- a/upup/pkg/fi/cloudup/alitasks/scalinggroup.go +++ b/upup/pkg/fi/cloudup/alitasks/scalinggroup.go @@ -68,7 +68,7 @@ func (s *ScalingGroup) Find(c *fi.Context) (*ScalingGroup, error) { } if len(groupList) > 1 { - glog.V(4).Info("The number of specified scalingGroup with the same name and ClusterTags exceeds 1, diskName:%q", *s.Name) + glog.V(4).Infof("The number of specified scalingGroup with the same name and ClusterTags exceeds 1, diskName:%q", *s.Name) } glog.V(2).Infof("found matching ScalingGroup with Name: %q", *s.Name) diff --git a/upup/pkg/fi/cloudup/aliup/ali_cloud.go b/upup/pkg/fi/cloudup/aliup/ali_cloud.go index 79b0da13047f8..9e9352d82f928 100644 --- a/upup/pkg/fi/cloudup/aliup/ali_cloud.go +++ b/upup/pkg/fi/cloudup/aliup/ali_cloud.go @@ -215,7 +215,7 @@ func (c *aliCloudImplementation) CreateTags(resourceId string, resourceType stri if len(tags) == 0 { return nil } else if len(tags) > 10 { - glog.V(4).Info("The number of specified resource's tags exceeds 10, resourceId:%q", resourceId) + glog.V(4).Infof("The number of specified resource's tags exceeds 10, resourceId:%q", resourceId) } if resourceId == "" { return errors.New("resourceId not provided to CreateTags") @@ -287,7 +287,7 @@ func (c *aliCloudImplementation) GetApiIngressStatus(cluster *kops.Cluster) ([]k return nil, nil } if len(responseLoadBalancers) > 1 { - glog.V(4).Info("The number of specified loadbalancer with the same name exceeds 1, loadbalancerName:%q", name) + glog.V(4).Infof("The number of specified loadbalancer with the same name exceeds 1, loadbalancerName:%q", name) } address := responseLoadBalancers[0].Address diff --git a/upup/pkg/fi/cloudup/awsup/aws_cloud.go b/upup/pkg/fi/cloudup/awsup/aws_cloud.go index 2a24b2fe83962..330ea746c1bb1 100644 --- a/upup/pkg/fi/cloudup/awsup/aws_cloud.go +++ b/upup/pkg/fi/cloudup/awsup/aws_cloud.go @@ -1018,11 +1018,11 @@ func ValidateZones(zones []string, cloud AWSCloud) error { } for _, message := range z.Messages { - glog.Warningf("Zone %q has message: %q", aws.StringValue(message.Message)) + glog.Warningf("Zone %q has message: %q", zone, aws.StringValue(message.Message)) } if aws.StringValue(z.State) != "available" { - glog.Warningf("Zone %q has state %q", aws.StringValue(z.State)) + glog.Warningf("Zone %q has state %q", zone, aws.StringValue(z.State)) } } diff --git a/upup/pkg/fi/files_owner.go b/upup/pkg/fi/files_owner.go index 677b190779a13..f9cb97ce80bb6 100644 --- a/upup/pkg/fi/files_owner.go +++ b/upup/pkg/fi/files_owner.go @@ -53,7 +53,7 @@ func EnsureFileOwner(destPath string, owner string, groupName string) (bool, err return changed, nil } - glog.Infof("Changing file owner/group for %q to %s:%s", destPath, owner, group) + glog.Infof("Changing file owner/group for %q to %s:%+v", destPath, owner, group) err = os.Lchown(destPath, user.Uid, group.Gid) if err != nil { return changed, fmt.Errorf("error setting file owner/group for %q: %v", destPath, err) diff --git a/upup/pkg/fi/fitasks/keypair.go b/upup/pkg/fi/fitasks/keypair.go index 4868ee553d226..c44a75dc9dbcb 100644 --- a/upup/pkg/fi/fitasks/keypair.go +++ b/upup/pkg/fi/fitasks/keypair.go @@ -263,7 +263,7 @@ func (e *Keypair) BuildCertificateTemplate() (*x509.Certificate, error) { } if len(subjectPkix.ToRDNSequence()) == 0 { - return nil, fmt.Errorf("Subject name was empty for SSL keypair %q", e.Name) + return nil, fmt.Errorf("Subject name was empty for SSL keypair %q", *e.Name) } template.Subject = *subjectPkix diff --git a/upup/pkg/fi/nodeup/nodetasks/file.go b/upup/pkg/fi/nodeup/nodetasks/file.go index fee47d8b07183..1f4df091691c9 100644 --- a/upup/pkg/fi/nodeup/nodetasks/file.go +++ b/upup/pkg/fi/nodeup/nodetasks/file.go @@ -310,7 +310,7 @@ func (_ *File) RenderCloudInit(t *cloudinit.CloudInitTarget, a, e, changes *File dirMode := os.FileMode(0755) fileMode, err := fi.ParseFileMode(fi.StringValue(e.Mode), 0644) if err != nil { - return fmt.Errorf("invalid file mode for %q: %q", e.Path, e.Mode) + return fmt.Errorf("invalid file mode for %s: %q", e.Path, *e.Mode) } if e.Type == FileType_Symlink { diff --git a/upup/pkg/fi/users.go b/upup/pkg/fi/users.go index f02c0e81d7217..bdc6c8ae346fa 100644 --- a/upup/pkg/fi/users.go +++ b/upup/pkg/fi/users.go @@ -54,18 +54,18 @@ func parseUsers() (map[string]*User, error) { tokens := strings.Split(line, ":") if len(tokens) < 7 { - glog.Warning("Ignoring malformed /etc/passwd line (too few tokens): %q", line) + glog.Warningf("Ignoring malformed /etc/passwd line (too few tokens): %q\n", line) continue } uid, err := strconv.Atoi(tokens[2]) if err != nil { - glog.Warning("Ignoring malformed /etc/passwd line (bad uid): %q", line) + glog.Warningf("Ignoring malformed /etc/passwd line (bad uid): %q", line) continue } gid, err := strconv.Atoi(tokens[3]) if err != nil { - glog.Warning("Ignoring malformed /etc/passwd line (bad gid): %q", line) + glog.Warningf("Ignoring malformed /etc/passwd line (bad gid): %q", line) continue } @@ -126,13 +126,13 @@ func parseGroups() (map[string]*Group, error) { tokens := strings.Split(line, ":") if len(tokens) < 4 { - glog.Warning("Ignoring malformed /etc/group line (too few tokens): %q", line) + glog.Warningf("Ignoring malformed /etc/group line (too few tokens): %q", line) continue } gid, err := strconv.Atoi(tokens[2]) if err != nil { - glog.Warning("Ignoring malformed /etc/group line (bad gid): %q", line) + glog.Warningf("Ignoring malformed /etc/group line (bad gid): %q", line) continue }