From 87e9bcae0d268e3fbef549bbc59dbb0d3d8ccb4c Mon Sep 17 00:00:00 2001 From: Vann Teves Date: Fri, 10 Aug 2018 17:08:04 -0700 Subject: [PATCH] Use log instead of fmt --- cmd/machine.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/machine.go b/cmd/machine.go index 2bcdd7b..a856f2f 100644 --- a/cmd/machine.go +++ b/cmd/machine.go @@ -648,7 +648,7 @@ func isUpgradeRequired(old *spv1.MachineComponentVersions, cur *spv1.MachineComp } func upgradeMachine(ip string) { - fmt.Printf("Upgrading machine %s\n", ip) + log.Printf("Upgrading machine %s\n", ip) oldMachine, err := state.ClusterClient.ClusterV1alpha1(). Machines(common.DefaultNamespace). @@ -670,7 +670,7 @@ func upgradeMachine(ip string) { upgradeRequired, upgrade := isUpgradeRequired(oldMachineSpec.ComponentVersions, currentComponentVersions) if !upgradeRequired { - fmt.Printf("Machine is up to date\n") + log.Println("Machine is up to date.") return } @@ -684,7 +684,7 @@ func upgradeMachine(ip string) { // and create a new one with the same specs as the old one createMachine(ip, oldProvisionedMachine.Spec.SSHConfig.Port, oldProvisionedMachine.Spec.VIPNetworkInterface, role, oldProvisionedMachine.Spec.SSHConfig.PublicKeys) - fmt.Println("Machine upgraded successfully.") + log.Println("Machine upgraded successfully.") return } @@ -692,7 +692,7 @@ func upgradeMachine(ip string) { if upgrade.NodeadmVersion || upgrade.EtcdadmVersion { oldMachineSpec.ComponentVersions.NodeadmVersion = currentComponentVersions.NodeadmVersion oldMachineSpec.ComponentVersions.EtcdadmVersion = currentComponentVersions.EtcdadmVersion - fmt.Println("Nodeadm/Etcdadm only change, updating state file") + log.Println("Nodeadm/Etcdadm only change, updating state file.") if err := sputil.PutMachineSpec(*oldMachineSpec, oldMachine); err != nil { log.Fatalf("unable to encode machine provider spec: %v", err) @@ -704,7 +704,7 @@ func upgradeMachine(ip string) { if err := state.PullFromAPIs(); err != nil { log.Fatalf("Unable to sync on-disk state: %v", err) } - fmt.Println("Machine upgraded successfully.") + log.Println("Machine upgraded successfully.") return } }