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

use klog.Info instead of klog.Infof when had no format #78889

Merged
merged 1 commit into from
Jun 19, 2019
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 deletions cluster/images/etcd/migrate/migrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ func (m *Migrator) MigrateIfNeeded(target *EtcdVersionPair) error {
}
return nil
case current.storageVersion == storageEtcd2 && target.storageVersion == storageEtcd3:
klog.Infof("upgrading from etcd2 storage to etcd3 storage")
klog.Info("upgrading from etcd2 storage to etcd3 storage")
current, err = m.etcd2ToEtcd3Upgrade(current, target)
case current.version.Major == 3 && target.version.Major == 2:
klog.Infof("downgrading from etcd 3.x to 2.x")
klog.Info("downgrading from etcd 3.x to 2.x")
current, err = m.rollbackToEtcd2(current, target)
case current.version.Major == target.version.Major && current.version.Minor < target.version.Minor:
stepVersion := m.cfg.supportedVersions.NextVersionPair(current)
Expand All @@ -116,7 +116,7 @@ func (m *Migrator) MigrateIfNeeded(target *EtcdVersionPair) error {

func (m *Migrator) backupEtcd2(current *EtcdVersion) error {
backupDir := fmt.Sprintf("%s/%s", m.dataDirectory, "migration-backup")
klog.Infof("Backup etcd before starting migration")
klog.Info("Backup etcd before starting migration")
err := os.Mkdir(backupDir, 0666)
if err != nil {
return fmt.Errorf("failed to create backup directory before starting migration: %v", err)
Expand Down Expand Up @@ -163,7 +163,7 @@ func (m *Migrator) rollbackEtcd3MinorVersion(current *EtcdVersionPair, target *E
return nil, err
}

klog.Infof("Backing up data before rolling back")
klog.Info("Backing up data before rolling back")
backupDir := fmt.Sprintf("%s.bak", m.dataDirectory)
err = os.RemoveAll(backupDir)
if err != nil {
Expand Down Expand Up @@ -195,7 +195,7 @@ func (m *Migrator) rollbackToEtcd2(current *EtcdVersionPair, target *EtcdVersion
if !(current.version.Major == 3 && current.version.Minor == 0 && target.version.Major == 2 && target.version.Minor == 2) {
return nil, fmt.Errorf("etcd3 -> etcd2 downgrade is supported only between 3.0.x and 2.2.x, got current %s target %s", current, target)
}
klog.Infof("Backup and remove all existing v2 data")
klog.Info("Backup and remove all existing v2 data")
err := m.dataDirectory.Backup()
if err != nil {
return nil, err
Expand All @@ -214,12 +214,12 @@ func (m *Migrator) etcd2ToEtcd3Upgrade(current *EtcdVersionPair, target *EtcdVer
}
runner := m.newServer()

klog.Infof("Performing etcd2 -> etcd3 migration")
klog.Info("Performing etcd2 -> etcd3 migration")
err := m.client.Migrate(target.version)
if err != nil {
return nil, err
}
klog.Infof("Attaching leases to TTL entries")
klog.Info("Attaching leases to TTL entries")

// Now attach lease to all keys.
// To do it, we temporarily start etcd on a random port (so that
Expand Down
2 changes: 1 addition & 1 deletion cluster/images/etcd/migrate/rollback_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func RollbackV3ToV2(migrateDatadir string, ttl time.Duration) error {
if err := snapshotter.SaveSnap(raftSnap); err != nil {
return err
}
klog.Infof("Finished successfully")
klog.Info("Finished successfully")
return nil
}

Expand Down