Skip to content

Commit

Permalink
Refresh vclusterOps (#958)
Browse files Browse the repository at this point in the history
This PR applied recent vclusterOps to K8s operator.

---------

Co-authored-by: releng <vertica-releng@opentext>
  • Loading branch information
cchen-vertica and releng authored Oct 15, 2024
1 parent 041ff12 commit 86ba4c3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ require (
github.com/onsi/gomega v1.24.2
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.14.0
github.com/vertica/vcluster v1.2.1-0.20240925182136-8726cf914324
github.com/vertica/vcluster v1.2.1-0.20241011155543-ef6bed459365
github.com/vertica/vertica-sql-go v1.1.1
go.uber.org/zap v1.25.0
golang.org/x/exp v0.0.0-20230905200255-921286631fa9
golang.org/x/text v0.14.0
gopkg.in/natefinch/lumberjack.v2 v2.0.0
k8s.io/api v0.26.2
Expand Down Expand Up @@ -74,7 +75,6 @@ require (
go.opencensus.io v0.24.0 // indirect
go.uber.org/multierr v1.10.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/oauth2 v0.15.0 // indirect
golang.org/x/sync v0.5.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,8 @@ github.com/theckman/yacspin v0.13.12 h1:CdZ57+n0U6JMuh2xqjnjRq5Haj6v1ner2djtLQRz
github.com/theckman/yacspin v0.13.12/go.mod h1:Rd2+oG2LmQi5f3zC3yeZAOl245z8QOvrH4OPOJNZxLg=
github.com/tonglil/buflogr v1.0.1 h1:WXFZLKxLfqcVSmckwiMCF8jJwjIgmStJmg63YKRF1p0=
github.com/tonglil/buflogr v1.0.1/go.mod h1:yYWwvSpn/3uAaqjf6mJg/XMiAciaR0QcRJH2gJGDxNE=
github.com/vertica/vcluster v1.2.1-0.20240925182136-8726cf914324 h1:BcSoq5Ayj4s5Ce7vgPuThHdCz50AJm8iYzFVHRp+UE0=
github.com/vertica/vcluster v1.2.1-0.20240925182136-8726cf914324/go.mod h1:yZ3lnvlwuXWgyCZ9Z6bMYisVjP6Ecffl+Lk5wGX/lPQ=
github.com/vertica/vcluster v1.2.1-0.20241011155543-ef6bed459365 h1:Pzpx+TgDSRrOH1suw21KAkxtAB5qPqf287/0ZUcwUAc=
github.com/vertica/vcluster v1.2.1-0.20241011155543-ef6bed459365/go.mod h1:yZ3lnvlwuXWgyCZ9Z6bMYisVjP6Ecffl+Lk5wGX/lPQ=
github.com/vertica/vertica-sql-go v1.1.1 h1:sZYijzBbvdAbJcl4cYlKjR+Eh/X1hGKzukWuhh8PjvI=
github.com/vertica/vertica-sql-go v1.1.1/go.mod h1:fGr44VWdEvL+f+Qt5LkKLOT7GoxaWdoUCnPBU9h6t04=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
Expand Down
10 changes: 5 additions & 5 deletions pkg/vadmin/replication_start_vc.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ func (v *VClusterOps) genReplicateDBOptions(s *replicationstart.Parms, certs *HT
opts.DBName = v.VDB.Spec.DBName
opts.UserName = s.SourceUserName
opts.Password = &v.Password
opts.TargetDB = s.TargetDBName
opts.TargetUserName = s.TargetUserName
opts.TargetDB.DBName = s.TargetDBName
opts.TargetDB.UserName = s.TargetUserName
opts.SandboxName = s.SourceSandboxName
if s.SourceTLSConfig != "" {
opts.TargetPassword = nil
opts.TargetDB.Password = nil
} else {
opts.TargetPassword = &s.TargetPassword
opts.TargetDB.Password = &s.TargetPassword
}
opts.TargetHosts = append(opts.TargetHosts, s.TargetIP)
opts.TargetDB.Hosts = append(opts.TargetDB.Hosts, s.TargetIP)
opts.SourceTLSConfig = s.SourceTLSConfig
opts.IsEon = v.VDB.IsEON()

Expand Down
10 changes: 5 additions & 5 deletions pkg/vadmin/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,18 +159,18 @@ func (m *MockVClusterOps) VerifyCommonOptions(options *vops.DatabaseOptions) err
// VerifyTargetDBNameUserNamePassword is used in vcluster-ops unit test for verifying the target db name,
// username and password in a replication
func (m *MockVClusterOps) VerifyTargetDBNameUserNamePassword(options *vops.VReplicationDatabaseOptions) error {
if options.TargetDB != TestTargetDBName {
if options.TargetDB.DBName != TestTargetDBName {
return fmt.Errorf("failed to retrieve target db name")
}
if options.TargetUserName != TestTargetUserName {
if options.TargetDB.UserName != TestTargetUserName {
return fmt.Errorf("failed to retrieve target username")
}
if options.SourceTLSConfig != "" {
if options.TargetPassword != nil {
if options.TargetDB.Password != nil {
return fmt.Errorf("target password is not nil when source TLS config is set")
}
} else {
if *options.TargetPassword != TestTargetPassword {
if *options.TargetDB.Password != TestTargetPassword {
return fmt.Errorf("failed to retrieve target password")
}
}
Expand Down Expand Up @@ -292,7 +292,7 @@ func (m *MockVClusterOps) VerifySourceAndTargetIPs(options *vops.VReplicationDat
if len(options.RawHosts) != 1 || options.RawHosts[0] != TestSourceIP {
return fmt.Errorf("failed to load source IP")
}
if len(options.TargetHosts) != 1 || options.TargetHosts[0] != TestTargetIP {
if len(options.TargetDB.Hosts) != 1 || options.TargetDB.Hosts[0] != TestTargetIP {
return fmt.Errorf("failed to load target IP")
}
return nil
Expand Down

0 comments on commit 86ba4c3

Please sign in to comment.