Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If don't use formatted output,fix logging calls #5911

Merged
merged 1 commit into from
Oct 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/featureflag/featureflag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func TestFlagToFalse(t *testing.T) {
}

// Really just to force a dependency on glog, so that we can pass -v and -logtostderr to go test
glog.Infof("Created flag Unittest1")
glog.Info("Created flag Unittest1")

ParseFlags("-UnitTest1")
if f.Enabled() {
Expand Down
12 changes: 6 additions & 6 deletions pkg/instancegroups/instancegroups.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ func promptInteractive(upgradedHostId, upgradedHostName string) (stopPrompting b
val = strings.ToLower(val)
switch val {
case "n":
glog.Infof("User signaled to stop")
glog.Info("User signaled to stop")
os.Exit(3)
case "a":
glog.Infof("Always Yes, stop prompting for rest of hosts")
glog.Info("Always Yes, stop prompting for rest of hosts")
stopPrompting = true
}
return stopPrompting, err
Expand Down Expand Up @@ -140,7 +140,7 @@ func (r *RollingUpdateInstanceGroup) RollingUpdate(rollingUpdateData *RollingUpd
return fmt.Errorf("error validating cluster: %v", err)
} else {
glog.V(2).Infof("Ignoring cluster validation error: %v", err)
glog.Infof("Cluster validation failed, but proceeding since fail-on-validate-error is set to false")
glog.Info("Cluster validation failed, but proceeding since fail-on-validate-error is set to false")
}
}
}
Expand All @@ -157,7 +157,7 @@ func (r *RollingUpdateInstanceGroup) RollingUpdate(rollingUpdateData *RollingUpd
// We don't want to validate for bastions - they aren't part of the cluster
} else if rollingUpdateData.CloudOnly {

glog.Warningf("Not draining cluster nodes as 'cloudonly' flag is set.")
glog.Warning("Not draining cluster nodes as 'cloudonly' flag is set.")

} else if featureflag.DrainAndValidateRollingUpdate.Enabled() {

Expand Down Expand Up @@ -206,7 +206,7 @@ func (r *RollingUpdateInstanceGroup) RollingUpdate(rollingUpdateData *RollingUpd
glog.Warningf("Not validating cluster as cloudonly flag is set.")

} else if featureflag.DrainAndValidateRollingUpdate.Enabled() {
glog.Infof("Validating the cluster.")
glog.Info("Validating the cluster.")

if err = r.ValidateClusterWithDuration(rollingUpdateData, cluster, instanceGroupList, validationTimeout); err != nil {

Expand Down Expand Up @@ -273,7 +273,7 @@ func (r *RollingUpdateInstanceGroup) tryValidateCluster(rollingUpdateData *Rolli
glog.Infof("Cluster did not pass validation, will try again in %q until duration %q expires: %v.", tickDuration, duration, result.Failures[0].Message)
return false
} else {
glog.Infof("Cluster validated.")
glog.Info("Cluster validated.")
return true
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/instancegroups/rollingupdate.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ type RollingUpdateCluster struct {
// RollingUpdate performs a rolling update on a K8s Cluster.
func (c *RollingUpdateCluster) RollingUpdate(groups map[string]*cloudinstances.CloudInstanceGroup, cluster *api.Cluster, instanceGroups *api.InstanceGroupList) error {
if len(groups) == 0 {
glog.Infof("Cloud Instance Group length is zero. Not doing a rolling-update.")
glog.Info("Cloud Instance Group length is zero. Not doing a rolling-update.")
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/kubeconfig/kubecfg_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (b *KubeconfigBuilder) DeleteKubeConfig() error {
}

if config == nil || clientcmdapi.IsConfigEmpty(config) {
glog.V(2).Infof("kubeconfig is empty")
glog.V(2).Info("kubeconfig is empty")
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/kubemanifest/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (m *Manifest) ToYAML() ([]byte, error) {

func (m *Manifest) accept(visitor Visitor) error {
err := visit(visitor, m.data, []string{}, func(v interface{}) {
glog.Fatalf("cannot mutate top-level data")
glog.Fatal("cannot mutate top-level data")
})
return err
}
2 changes: 1 addition & 1 deletion pkg/resources/aws/routetable.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func DescribeRouteTables(cloud fi.Cloud, clusterName string) (map[string]*ec2.Ro
c := cloud.(awsup.AWSCloud)

routeTables := make(map[string]*ec2.RouteTable)
glog.V(2).Infof("Listing EC2 RouteTables")
glog.V(2).Info("Listing EC2 RouteTables")
for _, filters := range buildEC2FiltersForCluster(clusterName) {
request := &ec2.DescribeRouteTablesInput{
Filters: filters,
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/aws/vpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func DescribeVPCs(cloud fi.Cloud, clusterName string) (map[string]*ec2.Vpc, erro
c := cloud.(awsup.AWSCloud)

vpcs := make(map[string]*ec2.Vpc)
glog.V(2).Infof("Listing EC2 VPC")
glog.V(2).Info("Listing EC2 VPC")
for _, filters := range buildEC2FiltersForCluster(clusterName) {
request := &ec2.DescribeVpcsInput{
Filters: filters,
Expand Down
6 changes: 3 additions & 3 deletions pkg/resources/digitalocean/cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,19 +82,19 @@ func NewCloud(region string) (*Cloud, error) {

// GetCloudGroups is not implemented yet, that needs to return the instances and groups that back a kops cluster.
func (c *Cloud) GetCloudGroups(cluster *kops.Cluster, instancegroups []*kops.InstanceGroup, warnUnmatched bool, nodes []v1.Node) (map[string]*cloudinstances.CloudInstanceGroup, error) {
glog.V(8).Infof("digitalocean cloud provider GetCloudGroups not implemented yet")
glog.V(8).Info("digitalocean cloud provider GetCloudGroups not implemented yet")
return nil, fmt.Errorf("digital ocean cloud provider does not support getting cloud groups at this time")
}

// DeleteGroup is not implemented yet, is a func that needs to delete a DO instance group.
func (c *Cloud) DeleteGroup(g *cloudinstances.CloudInstanceGroup) error {
glog.V(8).Infof("digitalocean cloud provider DeleteGroup not implemented yet")
glog.V(8).Info("digitalocean cloud provider DeleteGroup not implemented yet")
return fmt.Errorf("digital ocean cloud provider does not support deleting cloud groups at this time")
}

// DeleteInstance is not implemented yet, is func needs to delete a DO instance.
func (c *Cloud) DeleteInstance(i *cloudinstances.CloudInstanceGroupMember) error {
glog.V(8).Infof("digitalocean cloud provider DeleteInstance not implemented yet")
glog.V(8).Info("digitalocean cloud provider DeleteInstance not implemented yet")
return fmt.Errorf("digital ocean cloud provider does not support deleting cloud instances at this time")
}

Expand Down
12 changes: 6 additions & 6 deletions pkg/resources/digitalocean/dns/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,9 @@ func (r *resourceRecordChangeset) Upsert(rrset dnsprovider.ResourceRecordSet) dn
// Apply adds new records stored in r.additions, updates records stored
// in r.upserts and deletes records stored in r.removals
func (r *resourceRecordChangeset) Apply() error {
glog.V(2).Infof("applying changes in record change set")
glog.V(2).Info("applying changes in record change set")
if r.IsEmpty() {
glog.V(2).Infof("record change set is empty")
glog.V(2).Info("record change set is empty")
return nil
}

Expand All @@ -330,7 +330,7 @@ func (r *resourceRecordChangeset) Apply() error {
}
}

glog.V(2).Infof("record change set additions complete")
glog.V(2).Info("record change set additions complete")
}

if len(r.upserts) > 0 {
Expand All @@ -341,7 +341,7 @@ func (r *resourceRecordChangeset) Apply() error {
}
}

glog.V(2).Infof("record change set upserts complete")
glog.V(2).Info("record change set upserts complete")
}

if len(r.removals) > 0 {
Expand All @@ -361,10 +361,10 @@ func (r *resourceRecordChangeset) Apply() error {
}
}

glog.V(2).Infof("record change set removals complete")
glog.V(2).Info("record change set removals complete")
}

glog.V(2).Infof("record change sets successfully applied")
glog.V(2).Info("record change sets successfully applied")
return nil
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/resources/ops/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func DeleteResources(cloud fi.Cloud, resourceMap map[string]*resources.Resource)
}
}

glog.V(2).Infof("Dependencies")
glog.V(2).Info("Dependencies")
for k, v := range depMap {
glog.V(2).Infof("\t%s\t%v", k, v)
}
Expand Down Expand Up @@ -121,7 +121,7 @@ func DeleteResources(cloud fi.Cloud, resourceMap map[string]*resources.Resource)
err = trackers[0].GroupDeleter(cloud, trackers)
} else {
if len(trackers) != 1 {
glog.Fatalf("found group without groupKey")
glog.Fatal("found group without groupKey")
}
err = trackers[0].Deleter(cloud, trackers[0])
}
Expand Down