Skip to content

Commit

Permalink
Update all dependencies (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
majst01 authored Sep 11, 2024
1 parent 81b0f20 commit f60c9c8
Show file tree
Hide file tree
Showing 11 changed files with 296 additions and 253 deletions.
31 changes: 22 additions & 9 deletions api/v1/backup_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 20 additions & 8 deletions api/v1/database_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 20 additions & 8 deletions api/v1/initializer_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions cmd/internal/backup/providers/gcp/gcp_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ type connectionDetails struct {
func startFakeGcsContainer(t testing.TB, ctx context.Context) (testcontainers.Container, *connectionDetails) {
c, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{
ContainerRequest: testcontainers.ContainerRequest{
Image: "fsouza/fake-gcs-server", // tested with fsouza/fake-gcs-server:1.47.4
ExposedPorts: []string{"4443"},
Image: "fsouza/fake-gcs-server", // tested with fsouza/fake-gcs-server:1.47.4
// ExposedPorts: []string{"4443"},
HostConfigModifier: func(hc *container.HostConfig) {
// Unfortunately we must use host network as the public host must exactly match the client endpoint
// see for example: https://github.com/fsouza/fake-gcs-server/issues/196
Expand All @@ -212,7 +212,8 @@ func startFakeGcsContainer(t testing.TB, ctx context.Context) (testcontainers.Co
},
Cmd: []string{"-backend", "memory", "-log-level", "debug", "-public-host", "localhost:4443"},
WaitingFor: wait.ForAll(
wait.ForListeningPort("4443/tcp"),
// wait.ForListeningPort("4443/tcp"),
wait.ForLog("server started"),
),
},
Started: true,
Expand Down
2 changes: 1 addition & 1 deletion cmd/internal/backup/providers/local/versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func (b backupVersionsLocal) List() []*providers.BackupVersion {
common.Sort(result)

for i, backup := range result {
backup.Version = strconv.FormatInt(int64(i), 10)
backup.Version = strconv.FormatInt(int64(i), 10) // nolint:gosec
}

return result
Expand Down
14 changes: 7 additions & 7 deletions cmd/internal/database/postgres/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ func (db *Postgres) Upgrade(ctx context.Context) error {
return nil
}

if pgVersion == binaryVersionMajor {
if uint64(pgVersion) == binaryVersionMajor { // nolint:gosec
db.log.Info("no version difference, no upgrade required", "database-version", pgVersion, "binary-version", binaryVersionMajor)
return nil
}
if pgVersion > binaryVersionMajor {
if uint64(pgVersion) > binaryVersionMajor { // nolint:gosec
db.log.Error("database is newer than postgres binary, aborting", "database-version", pgVersion, "binary-version", binaryVersionMajor)
return fmt.Errorf("database is newer than postgres binary")
}
Expand All @@ -97,7 +97,7 @@ func (db *Postgres) Upgrade(ctx context.Context) error {
return nil
}

if oldBinaryVersionMajor != pgVersion {
if oldBinaryVersionMajor != uint64(pgVersion) { // nolint:gosec
db.log.Error("database version and old binary version do not match, skipping upgrade", "old database", pgVersion, "old binary", oldBinaryVersionMajor)
return nil
}
Expand Down Expand Up @@ -138,7 +138,7 @@ func (db *Postgres) Upgrade(ctx context.Context) error {
cmd.Stderr = os.Stderr
cmd.Env = os.Environ()
cmd.SysProcAttr = &syscall.SysProcAttr{
Credential: &syscall.Credential{Uid: uint32(uid)}, //nolint:gosec
Credential: &syscall.Credential{Uid: uint32(uid)}, // nolint:gosec
}
err = cmd.Run()
if err != nil {
Expand Down Expand Up @@ -203,7 +203,7 @@ func (db *Postgres) Upgrade(ctx context.Context) error {
cmd.Stderr = os.Stderr
cmd.Env = os.Environ()
cmd.SysProcAttr = &syscall.SysProcAttr{
Credential: &syscall.Credential{Uid: uint32(uid)}, //nolint:gosec
Credential: &syscall.Credential{Uid: uint32(uid)}, // nolint:gosec
}
cmd.Dir = pgUser.HomeDir

Expand Down Expand Up @@ -234,7 +234,7 @@ func (db *Postgres) Upgrade(ctx context.Context) error {

// Helpers

func (db *Postgres) getBinaryVersion(ctx context.Context, pgConfigCmd string) (int, error) {
func (db *Postgres) getBinaryVersion(ctx context.Context, pgConfigCmd string) (uint64, error) {
// pg_config --version
// PostgreSQL 12.16
cmd := exec.CommandContext(ctx, pgConfigCmd, "--version")
Expand All @@ -253,7 +253,7 @@ func (db *Postgres) getBinaryVersion(ctx context.Context, pgConfigCmd string) (i
return 0, fmt.Errorf("unable to parse postgres binary version in %q: %w", binaryVersionString, err)
}

return int(v.Major()), nil //nolint:gosec
return v.Major(), nil
}

func (db *Postgres) getDatabaseVersion(pgVersionFile string) (int, error) {
Expand Down
Loading

0 comments on commit f60c9c8

Please sign in to comment.