Skip to content

Commit

Permalink
feat: use cnpg-i machinery (#8)
Browse files Browse the repository at this point in the history
Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Marco Nenciarini <[email protected]>
Co-authored-by: Armando Ruocco <[email protected]>
Co-authored-by: Marco Nenciarini <[email protected]>
  • Loading branch information
3 people authored Feb 15, 2024
1 parent fb21225 commit 5245d42
Show file tree
Hide file tree
Showing 16 changed files with 23 additions and 519 deletions.
15 changes: 8 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,7 @@ toolchain go1.21.6
require (
github.com/cloudnative-pg/cloudnative-pg v1.22.1-0.20240123130737-a22a155b9eb8
github.com/cloudnative-pg/cnpg-i v0.0.0-20240202130713-14050b29b7a2
github.com/evanphx/json-patch/v5 v5.8.1
github.com/go-logr/logr v1.3.0
github.com/go-logr/zapr v1.2.4
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.1
github.com/spf13/cobra v1.8.0
github.com/spf13/viper v1.14.0
go.uber.org/zap v1.26.0
github.com/cloudnative-pg/cnpg-i-machinery v0.0.0-20240215100236-082604edc33a
google.golang.org/grpc v1.60.1
k8s.io/api v0.28.4
k8s.io/apimachinery v0.28.4
Expand All @@ -26,7 +20,10 @@ require (
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/evanphx/json-patch/v5 v5.8.1 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-logr/zapr v1.2.4 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
Expand All @@ -38,6 +35,7 @@ require (
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20230602150820-91b7bce49751 // indirect
github.com/google/uuid v1.5.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
Expand Down Expand Up @@ -70,11 +68,14 @@ require (
github.com/robfig/cron v1.2.0 // indirect
github.com/spf13/afero v1.9.2 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/cobra v1.8.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.14.0 // indirect
github.com/subosito/gotenv v1.4.1 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.26.0 // indirect
golang.org/x/crypto v0.18.0 // indirect
golang.org/x/exp v0.0.0-20231219160207-73b9e39aefca // indirect
golang.org/x/net v0.20.0 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ github.com/cloudnative-pg/cloudnative-pg v1.22.1-0.20240123130737-a22a155b9eb8 h
github.com/cloudnative-pg/cloudnative-pg v1.22.1-0.20240123130737-a22a155b9eb8/go.mod h1:r6blheO2ihiuqKbk6rqPN5//PPJnYtKCGT2OxpXtk2o=
github.com/cloudnative-pg/cnpg-i v0.0.0-20240202130713-14050b29b7a2 h1:7Cow1BF5rM3k7q+QYjJsPiYGZTK8w+uTGa4VZ3IbBpk=
github.com/cloudnative-pg/cnpg-i v0.0.0-20240202130713-14050b29b7a2/go.mod h1:0G5GXQVj09KvONIcYURyroL74zOFGjv4eI5OXz7/G/0=
github.com/cloudnative-pg/cnpg-i-machinery v0.0.0-20240215100236-082604edc33a h1:ccAuhOYdWRuPXNDOq4OuLOInfJAKPTvxmVd/FINiET4=
github.com/cloudnative-pg/cnpg-i-machinery v0.0.0-20240215100236-082604edc33a/go.mod h1:A2Zx68zGuz6N/mv/1Jxgn9D6fV9Uc+wA58knRrEHwfo=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
Expand Down
4 changes: 2 additions & 2 deletions internal/backup/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import (
"context"
"time"

"github.com/cloudnative-pg/cnpg-i-machinery/pkg/logging"
"github.com/cloudnative-pg/cnpg-i-machinery/pkg/pluginhelper"
"github.com/cloudnative-pg/cnpg-i/pkg/backup"

"github.com/cloudnative-pg/plugin-pvc-backup/internal/backup/executor"
"github.com/cloudnative-pg/plugin-pvc-backup/internal/backup/storage"
"github.com/cloudnative-pg/plugin-pvc-backup/pkg/logging"
"github.com/cloudnative-pg/plugin-pvc-backup/pkg/metadata"
"github.com/cloudnative-pg/plugin-pvc-backup/pkg/pluginhelper"
)

// Implementation is the implementation of the identity service
Expand Down
3 changes: 1 addition & 2 deletions internal/backup/executor/controldata.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ import (

"github.com/cloudnative-pg/cloudnative-pg/pkg/management/url"
"github.com/cloudnative-pg/cloudnative-pg/pkg/utils"

"github.com/cloudnative-pg/plugin-pvc-backup/pkg/logging"
"github.com/cloudnative-pg/cnpg-i-machinery/pkg/logging"
)

// getPgControlData obtains the pg_controldata from the instance HTTP endpoint
Expand Down
3 changes: 1 addition & 2 deletions internal/backup/executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ import (

apiv1 "github.com/cloudnative-pg/cloudnative-pg/api/v1"
"github.com/cloudnative-pg/cloudnative-pg/pkg/management/postgres/webserver"
"github.com/cloudnative-pg/cnpg-i-machinery/pkg/logging"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/client-go/util/retry"

"github.com/cloudnative-pg/plugin-pvc-backup/pkg/logging"
)

var (
Expand Down
3 changes: 2 additions & 1 deletion internal/backup/executor/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import (
"os/exec"
"path"

"github.com/cloudnative-pg/cnpg-i-machinery/pkg/logging"

"github.com/cloudnative-pg/plugin-pvc-backup/internal/fileutils"
"github.com/cloudnative-pg/plugin-pvc-backup/pkg/logging"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/operator/mutations.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ package operator
import (
"context"

"github.com/cloudnative-pg/cnpg-i-machinery/pkg/pluginhelper"
"github.com/cloudnative-pg/cnpg-i/pkg/operator"
corev1 "k8s.io/api/core/v1"

"github.com/cloudnative-pg/plugin-pvc-backup/pkg/metadata"
"github.com/cloudnative-pg/plugin-pvc-backup/pkg/pluginhelper"
)

// MutateCluster is called to mutate a cluster with the defaulting webhook.
Expand Down
2 changes: 1 addition & 1 deletion internal/operator/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import (
"context"
"fmt"

"github.com/cloudnative-pg/cnpg-i-machinery/pkg/pluginhelper"
"github.com/cloudnative-pg/cnpg-i/pkg/operator"

"github.com/cloudnative-pg/plugin-pvc-backup/pkg/metadata"
"github.com/cloudnative-pg/plugin-pvc-backup/pkg/pluginhelper"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions internal/wal/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ import (
"os"
"path"

"github.com/cloudnative-pg/cnpg-i-machinery/pkg/logging"
"github.com/cloudnative-pg/cnpg-i-machinery/pkg/pluginhelper"
"github.com/cloudnative-pg/cnpg-i/pkg/wal"

"github.com/cloudnative-pg/plugin-pvc-backup/internal/backup/storage"
"github.com/cloudnative-pg/plugin-pvc-backup/pkg/logging"
"github.com/cloudnative-pg/plugin-pvc-backup/pkg/metadata"
"github.com/cloudnative-pg/plugin-pvc-backup/pkg/pluginhelper"
)

type walStatMode string
Expand Down
4 changes: 2 additions & 2 deletions internal/wal/wal.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ import (
"context"
"path"

"github.com/cloudnative-pg/cnpg-i-machinery/pkg/logging"
"github.com/cloudnative-pg/cnpg-i-machinery/pkg/pluginhelper"
"github.com/cloudnative-pg/cnpg-i/pkg/wal"

"github.com/cloudnative-pg/plugin-pvc-backup/internal/backup/storage"
"github.com/cloudnative-pg/plugin-pvc-backup/internal/fileutils"
"github.com/cloudnative-pg/plugin-pvc-backup/pkg/logging"
"github.com/cloudnative-pg/plugin-pvc-backup/pkg/metadata"
"github.com/cloudnative-pg/plugin-pvc-backup/pkg/pluginhelper"
)

// Archive copies one WAL file into the archive
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"fmt"
"os"

"github.com/cloudnative-pg/cnpg-i-machinery/pkg/pluginhelper"
"github.com/cloudnative-pg/cnpg-i/pkg/backup"
"github.com/cloudnative-pg/cnpg-i/pkg/operator"
"github.com/cloudnative-pg/cnpg-i/pkg/wal"
Expand All @@ -30,7 +31,6 @@ import (
"github.com/cloudnative-pg/plugin-pvc-backup/internal/identity"
operatorImpl "github.com/cloudnative-pg/plugin-pvc-backup/internal/operator"
walImpl "github.com/cloudnative-pg/plugin-pvc-backup/internal/wal"
"github.com/cloudnative-pg/plugin-pvc-backup/pkg/pluginhelper"
)

func main() {
Expand Down
18 changes: 0 additions & 18 deletions pkg/logging/doc.go

This file was deleted.

64 changes: 0 additions & 64 deletions pkg/logging/logging.go

This file was deleted.

19 changes: 0 additions & 19 deletions pkg/pluginhelper/doc.go

This file was deleted.

Loading

0 comments on commit 5245d42

Please sign in to comment.