diff --git a/internal/pkg/agent/migration/migrate_config.go b/internal/pkg/agent/migration/migrate_config.go index c2d1cfb87a1..c85122128ad 100644 --- a/internal/pkg/agent/migration/migrate_config.go +++ b/internal/pkg/agent/migration/migrate_config.go @@ -32,8 +32,8 @@ func MigrateToEncryptedConfig(ctx context.Context, l *logp.Logger, unencryptedCo unencStat, unencFileErr := os.Stat(unencryptedConfigPath) - l.Debugf("checking stat of enc config %q: %+v, err: %v", encryptedConfigPath, encStat, encFileErr) - l.Debugf("checking stat of unenc config %q: %+v, err: %v", unencryptedConfigPath, unencStat, unencFileErr) + l.Debugf(fmt.Sprintf("checking stat of enc config %q: %+v, err: %v", encryptedConfigPath, encStat, encFileErr)) + l.Debugf(fmt.Sprintf("checking stat of unenc config %q: %+v, err: %v", unencryptedConfigPath, unencStat, unencFileErr)) isEncryptedConfigEmpty := errors.Is(encFileErr, fs.ErrNotExist) || encStat.Size() == 0 isUnencryptedConfigPresent := unencFileErr == nil && unencStat.Size() > 0 @@ -42,7 +42,7 @@ func MigrateToEncryptedConfig(ctx context.Context, l *logp.Logger, unencryptedCo return nil } - l.Info("Initiating migration of %q to %q", unencryptedConfigPath, encryptedConfigPath) + l.Info(fmt.Sprintf("Initiating migration of %q to %q", unencryptedConfigPath, encryptedConfigPath)) legacyStore, err := storage.NewDiskStore(unencryptedConfigPath) if err != nil { return fmt.Errorf("error instantiating disk store: %w", err) @@ -54,7 +54,7 @@ func MigrateToEncryptedConfig(ctx context.Context, l *logp.Logger, unencryptedCo defer func() { err = reader.Close() if err != nil { - l.Errorf("Error closing unencrypted store reader for %q: %v", unencryptedConfigPath, err) + l.Errorf(fmt.Sprintf("Error closing unencrypted store reader for %q: %v", unencryptedConfigPath, err)) } }() store, err := storage.NewEncryptedDiskStore(ctx, encryptedConfigPath, storageOpts...) @@ -65,7 +65,7 @@ func MigrateToEncryptedConfig(ctx context.Context, l *logp.Logger, unencryptedCo if err != nil { return errors.New(err, fmt.Sprintf("error writing encrypted config from file %q to file %q", unencryptedConfigPath, encryptedConfigPath)) } - l.Info("Migration of %q to %q complete", unencryptedConfigPath, encryptedConfigPath) + l.Info(fmt.Sprintf("Migration of %q to %q complete", unencryptedConfigPath, encryptedConfigPath)) return nil }