Skip to content

Commit

Permalink
PMM-13129 Disable migration encryption until it is done.
Browse files Browse the repository at this point in the history
  • Loading branch information
JiriCtvrtka committed Jun 27, 2024
1 parent 92a1b59 commit e3fe487
Showing 1 changed file with 32 additions and 34 deletions.
66 changes: 32 additions & 34 deletions managed/models/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit e3fe487

Please sign in to comment.