diff --git a/go.mod b/go.mod index 9b13063..d0d9b90 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,6 @@ require ( github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 github.com/lib/pq v1.10.9 github.com/meilisearch/meilisearch-go v0.26.1 - github.com/metal-stack/metal-lib v0.14.4 github.com/metal-stack/v v1.0.3 github.com/mholt/archiver/v3 v3.5.1 github.com/olekukonko/tablewriter v0.0.5 @@ -126,6 +125,7 @@ require ( github.com/sourcegraph/conc v0.3.0 // indirect github.com/spf13/cast v1.6.0 // indirect github.com/spf13/pflag v1.0.5 // indirect + github.com/stretchr/objx v0.5.1 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/tklauser/go-sysconf v0.3.13 // indirect github.com/tklauser/numcpus v0.7.0 // indirect @@ -142,6 +142,7 @@ require ( go.opentelemetry.io/otel v1.22.0 // indirect go.opentelemetry.io/otel/metric v1.22.0 // indirect go.opentelemetry.io/otel/trace v1.22.0 // indirect + go.uber.org/goleak v1.3.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 @@ -154,6 +155,7 @@ require ( golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.5.0 // indirect golang.org/x/tools v0.17.0 // indirect + golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917 // indirect diff --git a/go.sum b/go.sum index 5e84959..cc9b2ed 100644 --- a/go.sum +++ b/go.sum @@ -239,8 +239,6 @@ github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZ github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/meilisearch/meilisearch-go v0.26.1 h1:3bmo2uLijX7kvBmiZ9LupVfC95TFcRJDgrRTzbOoE4A= github.com/meilisearch/meilisearch-go v0.26.1/go.mod h1:SxuSqDcPBIykjWz1PX+KzsYzArNLSCadQodWs8extS0= -github.com/metal-stack/metal-lib v0.14.4 h1:vm2868vcua6khoyWL7d0to8Hq5RayrjMse0FZTyWEec= -github.com/metal-stack/metal-lib v0.14.4/go.mod h1:Z3PAh8dkyWC4B19fXsu6EYwXXee0Lk9JZbjoHPLbDbc= github.com/metal-stack/v v1.0.3 h1:Sh2oBlnxrCUD+mVpzfC8HiqL045YWkxs0gpTvkjppqs= github.com/metal-stack/v v1.0.3/go.mod h1:YTahEu7/ishwpYKnp/VaW/7nf8+PInogkfGwLcGPdXg= github.com/mholt/archiver/v3 v3.5.1 h1:rDjOBX9JSF5BvoJGvjqK479aL70qh9DIpZCl+k7Clwo= diff --git a/pkg/generate/examples/examples/common.go b/pkg/generate/examples/examples/common.go index e843ba5..9442f6d 100644 --- a/pkg/generate/examples/examples/common.go +++ b/pkg/generate/examples/examples/common.go @@ -3,3 +3,7 @@ package examples const ( backupRestoreSidecarContainerImage = "ghcr.io/metal-stack/backup-restore-sidecar:latest" ) + +func pointer[T any](t T) *T { + return &t +} diff --git a/pkg/generate/examples/examples/etcd.go b/pkg/generate/examples/examples/etcd.go index 77ddbd6..3d6ec95 100644 --- a/pkg/generate/examples/examples/etcd.go +++ b/pkg/generate/examples/examples/etcd.go @@ -2,7 +2,6 @@ package examples import ( "github.com/metal-stack/backup-restore-sidecar/pkg/constants" - "github.com/metal-stack/metal-lib/pkg/pointer" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" @@ -31,7 +30,7 @@ func EtcdSts(namespace string) *appsv1.StatefulSet { }, Spec: appsv1.StatefulSetSpec{ ServiceName: "etcd", - Replicas: pointer.Pointer(int32(1)), + Replicas: pointer(int32(1)), Selector: &metav1.LabelSelector{ MatchLabels: map[string]string{ "app": "etcd", diff --git a/pkg/generate/examples/examples/keydb.go b/pkg/generate/examples/examples/keydb.go index b387c57..7082d11 100644 --- a/pkg/generate/examples/examples/keydb.go +++ b/pkg/generate/examples/examples/keydb.go @@ -2,7 +2,6 @@ package examples import ( "github.com/metal-stack/backup-restore-sidecar/pkg/constants" - "github.com/metal-stack/metal-lib/pkg/pointer" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" @@ -30,7 +29,7 @@ func KeyDBSts(namespace string) *appsv1.StatefulSet { }, Spec: appsv1.StatefulSetSpec{ ServiceName: "keydb", - Replicas: pointer.Pointer(int32(1)), + Replicas: pointer(int32(1)), Selector: &metav1.LabelSelector{ MatchLabels: map[string]string{ "app": "keydb", diff --git a/pkg/generate/examples/examples/localfs.go b/pkg/generate/examples/examples/localfs.go index 31c48cd..e25b178 100644 --- a/pkg/generate/examples/examples/localfs.go +++ b/pkg/generate/examples/examples/localfs.go @@ -2,7 +2,6 @@ package examples import ( "github.com/metal-stack/backup-restore-sidecar/pkg/constants" - "github.com/metal-stack/metal-lib/pkg/pointer" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" @@ -30,7 +29,7 @@ func LocalfsSts(namespace string) *appsv1.StatefulSet { }, Spec: appsv1.StatefulSetSpec{ ServiceName: "localfs", - Replicas: pointer.Pointer(int32(1)), + Replicas: pointer(int32(1)), Selector: &metav1.LabelSelector{ MatchLabels: map[string]string{ "app": "localfs", diff --git a/pkg/generate/examples/examples/meilisearch.go b/pkg/generate/examples/examples/meilisearch.go index 75ea16d..b1145c7 100644 --- a/pkg/generate/examples/examples/meilisearch.go +++ b/pkg/generate/examples/examples/meilisearch.go @@ -2,7 +2,6 @@ package examples import ( "github.com/metal-stack/backup-restore-sidecar/pkg/constants" - "github.com/metal-stack/metal-lib/pkg/pointer" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" @@ -33,7 +32,7 @@ func MeilisearchSts(namespace string) *appsv1.StatefulSet { }, Spec: appsv1.StatefulSetSpec{ ServiceName: "meilisearch", - Replicas: pointer.Pointer(int32(1)), + Replicas: pointer(int32(1)), Selector: &metav1.LabelSelector{ MatchLabels: map[string]string{ "app": "meilisearch", diff --git a/pkg/generate/examples/examples/postgres.go b/pkg/generate/examples/examples/postgres.go index 8b75f91..d4d9ec0 100644 --- a/pkg/generate/examples/examples/postgres.go +++ b/pkg/generate/examples/examples/postgres.go @@ -2,7 +2,6 @@ package examples import ( "github.com/metal-stack/backup-restore-sidecar/pkg/constants" - "github.com/metal-stack/metal-lib/pkg/pointer" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" @@ -36,7 +35,7 @@ func PostgresSts(namespace string) *appsv1.StatefulSet { }, Spec: appsv1.StatefulSetSpec{ ServiceName: "postgres", - Replicas: pointer.Pointer(int32(1)), + Replicas: pointer(int32(1)), Selector: &metav1.LabelSelector{ MatchLabels: map[string]string{ "app": "postgres", diff --git a/pkg/generate/examples/examples/redis.go b/pkg/generate/examples/examples/redis.go index 803e87d..99a9e12 100644 --- a/pkg/generate/examples/examples/redis.go +++ b/pkg/generate/examples/examples/redis.go @@ -2,7 +2,6 @@ package examples import ( "github.com/metal-stack/backup-restore-sidecar/pkg/constants" - "github.com/metal-stack/metal-lib/pkg/pointer" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" @@ -30,7 +29,7 @@ func RedisSts(namespace string) *appsv1.StatefulSet { }, Spec: appsv1.StatefulSetSpec{ ServiceName: "redis", - Replicas: pointer.Pointer(int32(1)), + Replicas: pointer(int32(1)), Selector: &metav1.LabelSelector{ MatchLabels: map[string]string{ "app": "redis", diff --git a/pkg/generate/examples/examples/rethinkdb.go b/pkg/generate/examples/examples/rethinkdb.go index 57de656..5caf579 100644 --- a/pkg/generate/examples/examples/rethinkdb.go +++ b/pkg/generate/examples/examples/rethinkdb.go @@ -2,7 +2,6 @@ package examples import ( "github.com/metal-stack/backup-restore-sidecar/pkg/constants" - "github.com/metal-stack/metal-lib/pkg/pointer" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" @@ -34,7 +33,7 @@ func RethinkDbSts(namespace string) *appsv1.StatefulSet { }, Spec: appsv1.StatefulSetSpec{ ServiceName: "rethinkdb", - Replicas: pointer.Pointer(int32(1)), + Replicas: pointer(int32(1)), Selector: &metav1.LabelSelector{ MatchLabels: map[string]string{ "app": "rethinkdb",