From e3fe487f2ce37ee3a7728d7428969c426bbfffec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C4=8Ctvrtka?= Date: Thu, 27 Jun 2024 11:57:50 +0200 Subject: [PATCH] PMM-13129 Disable migration encryption until it is done. --- managed/models/database.go | 66 ++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 34 deletions(-) diff --git a/managed/models/database.go b/managed/models/database.go index f19330b52b..ffb5c83833 100644 --- a/managed/models/database.go +++ b/managed/models/database.go @@ -36,8 +36,6 @@ import ( "google.golang.org/grpc/status" "gopkg.in/reform.v1" "gopkg.in/reform.v1/dialects/postgresql" - - "github.com/percona/pmm/managed/utils/encryption" ) const ( @@ -1065,38 +1063,38 @@ func SetupDB(ctx context.Context, sqlDB *sql.DB, params SetupDBParams) (*reform. return nil, err } - host, p, err := net.SplitHostPort(params.Address) - if err != nil { - return nil, err - } - - port, err := strconv.ParseInt(p, 10, 16) - if err != nil { - return nil, err - } - - c := &encryption.DatabaseConnection{ - Host: host, - Port: int16(port), - User: params.Username, - Password: params.Password, - SSLMode: params.SSLMode, - SSLCAPath: params.SSLCAPath, - SSLKeyPath: params.SSLKeyPath, - SSLCertPath: params.SSLCertPath, - EncryptedItems: []encryption.EncryptedItem{ - { - Database: "pmm-managed", - Table: "agents", - Identificators: []string{"agent_id"}, - Columns: []string{"username", "password"}, - }, - }, - } - - if err := encryption.EncryptDB(ctx, c); err != nil { - return nil, err - } + // host, p, err := net.SplitHostPort(params.Address) + // if err != nil { + // return nil, err + // } + + // port, err := strconv.ParseInt(p, 10, 16) + // if err != nil { + // return nil, err + // } + + // c := &encryption.DatabaseConnection{ + // Host: host, + // Port: int16(port), + // User: params.Username, + // Password: params.Password, + // SSLMode: params.SSLMode, + // SSLCAPath: params.SSLCAPath, + // SSLKeyPath: params.SSLKeyPath, + // SSLCertPath: params.SSLCertPath, + // EncryptedItems: []encryption.EncryptedItem{ + // { + // Database: "pmm-managed", + // Table: "agents", + // Identificators: []string{"agent_id"}, + // Columns: []string{"username", "password"}, + // }, + // }, + // } + + // if err := encryption.EncryptDB(ctx, c); err != nil { + // return nil, err + // } return db, nil }