Skip to content

Commit

Permalink
feat(backupbackingimage): add parameters to backup backing image crea…
Browse files Browse the repository at this point in the history
…te proto

ref: longhorn/longhorn 8884

Signed-off-by: Jack Lin <[email protected]>
  • Loading branch information
ChanYiLin committed Aug 23, 2024
1 parent e42c3c8 commit cfca594
Show file tree
Hide file tree
Showing 497 changed files with 121,819 additions and 37,984 deletions.
40 changes: 22 additions & 18 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,61 +8,65 @@ require (
github.com/RoaringBitmap/roaring v1.9.4
github.com/golang/protobuf v1.5.4
github.com/gorilla/mux v1.8.1
github.com/longhorn/backupstore v0.0.0-20240709004445-1cadf9073de3
github.com/longhorn/go-common-libs v0.0.0-20240707062002-b9354601827e
github.com/longhorn/backupstore v0.0.0-20240823072635-7afd6aa10d3e
github.com/longhorn/go-common-libs v0.0.0-20240821134112-907f57efd48f
github.com/longhorn/longhorn-engine v1.6.0-dev-20231217.0.20240418025706-519598108463
github.com/longhorn/sparse-tools v0.0.0-20240703010727-92451e38077a
github.com/longhorn/types v0.0.0-20240706151541-33cb010c3544
github.com/longhorn/types v0.0.0-20240725040629-473d671316c4
github.com/pkg/errors v0.9.1
github.com/rancher/go-fibmap v0.0.0-20160418233256-5fc9f8c1ed47
github.com/sirupsen/logrus v1.9.3
github.com/urfave/cli v1.22.15
golang.org/x/net v0.27.0
golang.org/x/net v0.28.0
google.golang.org/grpc v1.65.0
google.golang.org/protobuf v1.34.2
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c
)

require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3 // indirect
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0 // indirect
github.com/aws/aws-sdk-go v1.34.2 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.4.0 // indirect
github.com/aws/aws-sdk-go v1.55.5 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.12.0 // indirect
github.com/c9s/goprocinfo v0.0.0-20210130143923-c95fcf8c64a8 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
github.com/felixge/httpsnoop v1.0.3 // indirect
github.com/gammazero/deque v0.2.1 // indirect
github.com/gammazero/workerpool v1.1.3 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/godbus/dbus/v5 v5.1.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/handlers v1.5.2 // indirect
github.com/jmespath/go-jmespath v0.3.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mitchellh/go-ps v1.0.0 // indirect
github.com/moby/sys/mountinfo v0.6.2 // indirect
github.com/moby/sys/mountinfo v0.7.1 // indirect
github.com/mschoch/smat v0.2.0 // indirect
github.com/opencontainers/runc v1.1.13 // indirect
github.com/opencontainers/runtime-spec v1.0.3-0.20220909204839-494a5a6aca78 // indirect
github.com/pierrec/lz4/v4 v4.1.21 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/prometheus/client_golang v1.15.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/shirou/gopsutil/v3 v3.24.5 // indirect
github.com/slok/goresilience v0.2.0 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
golang.org/x/sys v0.22.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/sys v0.24.0 // indirect
golang.org/x/text v0.17.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect
k8s.io/apimachinery v0.30.2 // indirect
k8s.io/klog/v2 v2.120.1 // indirect
k8s.io/mount-utils v0.30.2 // indirect
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
k8s.io/apimachinery v0.31.0 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/mount-utils v0.31.0 // indirect
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect
)
136 changes: 69 additions & 67 deletions go.sum

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions pkg/backup/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type CreateBackupParameters struct {
CompressionMethod string
ConcurrentLimit int32
Labels []string
Parameters map[string]string
}

func DoBackupInit(params *CreateBackupParameters) (*backupbackingimage.BackupBackingImage, *backingimage.BackupStatus, *backupbackingimage.BackupConfig, error) {
Expand Down Expand Up @@ -71,6 +72,7 @@ func DoBackupInit(params *CreateBackupParameters) (*backupbackingimage.BackupBac
Name: params.Name,
ConcurrentLimit: params.ConcurrentLimit,
DestURL: params.DestURL,
Parameters: params.Parameters,
}
return backupBackingImage, backupStatus, backupConfig, nil
}
Expand Down
3 changes: 2 additions & 1 deletion pkg/client/manager_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ func (cli *BackingImageManagerClient) Watch() (*api.BackingImageStream, error) {
return api.NewBackingImageStream(conn, cancel, stream), nil
}

func (cli *BackingImageManagerClient) BackupCreate(name, uuid, checksum, backupTargetURL string, labels, credential map[string]string, compressionMethod string, concurrentLimit int) error {
func (cli *BackingImageManagerClient) BackupCreate(name, uuid, checksum, backupTargetURL string, labels, credential map[string]string, compressionMethod string, concurrentLimit int, parameters map[string]string) error {
if name == "" || uuid == "" || checksum == "" {
return fmt.Errorf("failed to create backup backing image: missing required parameter")
}
Expand Down Expand Up @@ -269,6 +269,7 @@ func (cli *BackingImageManagerClient) BackupCreate(name, uuid, checksum, backupT
Credential: credential,
CompressionMethod: compressionMethod,
ConcurrentLimit: int32(concurrentLimit),
Parameters: parameters,
})
return err
}
Expand Down
1 change: 1 addition & 0 deletions pkg/manager/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,7 @@ func (m *Manager) BackupCreate(ctx context.Context, req *rpc.BackupCreateRequest
CompressionMethod: req.CompressionMethod,
ConcurrentLimit: req.ConcurrentLimit,
Labels: req.Labels,
Parameters: req.Parameters,
})
if err != nil {
return nil, errors.Wrapf(err, "failed to initialize backup %v", req.Name)
Expand Down
Loading

0 comments on commit cfca594

Please sign in to comment.