Skip to content

Commit

Permalink
support google storage (#421)
Browse files Browse the repository at this point in the history
  • Loading branch information
MegaByte875 authored Jan 22, 2024
1 parent 68ccdc7 commit be1f47c
Show file tree
Hide file tree
Showing 10 changed files with 288 additions and 163 deletions.
14 changes: 14 additions & 0 deletions apis/apps/v1alpha1/nebularestore_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ type NebulaRestore struct {
}

// +kubebuilder:object:root=true

// NebulaRestoreList contains a list of NebulaRestore.
type NebulaRestoreList struct {
metav1.TypeMeta `json:",inline"`
Expand Down Expand Up @@ -100,6 +101,7 @@ type BRConfig struct {

type StorageProvider struct {
S3 *S3StorageProvider `json:"s3,omitempty"`
GS *GsStorageProvider `json:"gs,omitempty"`
}

// S3StorageProvider represents a S3 compliant storage for storing backups.
Expand All @@ -115,6 +117,18 @@ type S3StorageProvider struct {
SecretName string `json:"secretName,omitempty"`
}

// GsStorageProvider represents a GS compliant storage for storing backups.
type GsStorageProvider struct {
// Location in which the gs bucket is located.
Location string `json:"location,omitempty"`
// Bucket in which to store the backup data.
Bucket string `json:"bucket,omitempty"`
// SecretName is the name of secret which stores
// the GS service account or refresh token JSON.
// Secret key: credentials
SecretName string `json:"secretName,omitempty"`
}

// RestoreSpec contains the specification for a restore of a nebula cluster backup.
type RestoreSpec struct {
// +optional
Expand Down
20 changes: 20 additions & 0 deletions apis/apps/v1alpha1/zz_generated.deepcopy.go

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

9 changes: 9 additions & 0 deletions config/crd/bases/apps.nebula-graph.io_nebularestores.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ spec:
concurrency:
format: int32
type: integer
gs:
properties:
bucket:
type: string
location:
type: string
secretName:
type: string
type: object
s3:
properties:
bucket:
Expand Down
47 changes: 31 additions & 16 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.20
require (
github.com/caarlos0/env/v8 v8.0.0
github.com/go-playground/validator/v10 v10.15.5
github.com/google/go-cmp v0.5.9
github.com/google/go-cmp v0.6.0
github.com/hashicorp/go-multierror v1.1.1
github.com/joho/godotenv v1.5.1
github.com/onsi/gomega v1.27.7
Expand All @@ -15,8 +15,8 @@ require (
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.8.2
github.com/vesoft-inc/fbthrift v0.0.0-20230214024353-fa2f34755b28
github.com/vesoft-inc/nebula-agent/v3 v3.6.0
github.com/vesoft-inc/nebula-go/v3 v3.6.0
github.com/vesoft-inc/nebula-agent/v3 v3.0.0-20240121092931-48f6876d30de
github.com/vesoft-inc/nebula-go/v3 v3.6.2-0.20240108060629-6eb07e9b9e0f
github.com/vesoft-inc/nebula-importer/v4 v4.0.0
github.com/vesoft-inc/nebula-operator/apis v0.0.0-00010101000000-000000000000
gopkg.in/yaml.v3 v3.0.1
Expand All @@ -40,6 +40,11 @@ require (
)

require (
cloud.google.com/go v0.110.10 // indirect
cloud.google.com/go/compute v1.23.3 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v1.1.5 // indirect
cloud.google.com/go/storage v1.36.0 // indirect
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/MakeNowJust/heredoc v1.0.0 // indirect
github.com/NYTimes/gziphandler v1.1.1 // indirect
Expand Down Expand Up @@ -83,8 +88,12 @@ require (
github.com/google/cel-go v0.12.6 // indirect
github.com/google/gnostic v0.6.9 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/google/uuid v1.4.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
github.com/googleapis/google-cloud-go-testing v0.0.0-20210719221736-1c9a4c676720 // indirect
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect
Expand Down Expand Up @@ -122,21 +131,23 @@ require (
github.com/opencontainers/selinux v1.10.0 // indirect
github.com/panjf2000/ants v1.2.1 // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/pkg/sftp v1.13.5 // indirect
github.com/pkg/sftp v1.13.6 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.15.1 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/stoewer/go-strcase v1.2.0 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/vladimirvivien/gexe v0.2.0 // indirect
github.com/xlab/treeprint v1.1.0 // indirect
go.etcd.io/etcd/api/v3 v3.5.7 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.7 // indirect
go.etcd.io/etcd/client/v3 v3.5.7 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.35.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.35.1 // indirect
go.opentelemetry.io/otel v1.10.0 // indirect
Expand All @@ -151,21 +162,25 @@ require (
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/crypto v0.7.0 // indirect
golang.org/x/crypto v0.18.0 // indirect
golang.org/x/mod v0.10.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/oauth2 v0.7.0 // indirect
golang.org/x/sync v0.2.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/term v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/net v0.20.0 // indirect
golang.org/x/oauth2 v0.15.0 // indirect
golang.org/x/sync v0.5.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/term v0.16.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.9.1 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect
google.golang.org/api v0.152.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20221202195650-67e5cbc046fd // indirect
google.golang.org/grpc v1.51.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f // indirect
google.golang.org/grpc v1.59.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand Down
Loading

0 comments on commit be1f47c

Please sign in to comment.