Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(backupbackingimage): add parameters to backup backing image create proto #179

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions backupbackingimage/backupbackingimage.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"github.com/pkg/errors"
"github.com/sirupsen/logrus"

lhbackup "github.com/longhorn/go-common-libs/backup"

"github.com/longhorn/backupstore"
"github.com/longhorn/backupstore/common"
"github.com/longhorn/backupstore/types"
Expand All @@ -31,6 +33,8 @@
CompressionMethod string
CreatedTime string
CompleteTime string
Secret string
SecretNamespace string

ProcessingBlocks *common.ProcessingBlocks

Expand All @@ -41,6 +45,7 @@
Name string
DestURL string
ConcurrentLimit int32
Parameters map[string]string
}

type RestoreConfig struct {
Expand Down Expand Up @@ -180,6 +185,8 @@
backupBackingImage.Blocks = common.SortBackupBlocks(backupBackingImage.Blocks, backupBackingImage.Size, mappings.BlockSize)
backupBackingImage.CompleteTime = util.Now()
backupBackingImage.BlockCount = totalBlockCounts
backupBackingImage.Secret = config.Parameters[lhbackup.LonghornBackupBackingImageParameterSecret]
backupBackingImage.SecretNamespace = config.Parameters[lhbackup.LonghornBackupBackingImageParameterSecretNamespace]

Check warning on line 189 in backupbackingimage/backupbackingimage.go

View check run for this annotation

Codecov / codecov/patch

backupbackingimage/backupbackingimage.go#L188-L189

Added lines #L188 - L189 were not covered by tests
if err := saveBackingImageConfig(bsDriver, backupBackingImage); err != nil {
return progress.Progress, "", err
}
Expand Down
4 changes: 4 additions & 0 deletions backupbackingimage/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@
Checksum string
Labels map[string]string
CompressionMethod string `json:",omitempty"`
Secret string
SecretNamespace string
}

func InspectBackupBackingImage(backupURL string) (*BackupInfo, error) {
Expand Down Expand Up @@ -217,5 +219,7 @@
Checksum: backupBackingImage.Checksum,
Labels: backupBackingImage.Labels,
CompressionMethod: backupBackingImage.CompressionMethod,
Secret: backupBackingImage.Secret,
SecretNamespace: backupBackingImage.SecretNamespace,

Check warning on line 223 in backupbackingimage/config.go

View check run for this annotation

Codecov / codecov/patch

backupbackingimage/config.go#L222-L223

Added lines #L222 - L223 were not covered by tests
}
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/aws/aws-sdk-go v1.55.5
github.com/gammazero/workerpool v1.1.3
github.com/google/uuid v1.6.0
github.com/longhorn/go-common-libs v0.0.0-20240811024046-b6ddc3efb72e
github.com/longhorn/go-common-libs v0.0.0-20240821134112-907f57efd48f
github.com/pierrec/lz4/v4 v4.1.21
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.9.3
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/longhorn/go-common-libs v0.0.0-20240811024046-b6ddc3efb72e h1:cmns0zh6HMocqH7tnjFrgI8mf/h1i0bbnLznWfjQ63k=
github.com/longhorn/go-common-libs v0.0.0-20240811024046-b6ddc3efb72e/go.mod h1:Yrq49KPpchy++7Z15GrMKPkiwr5IduPboLTL99a1TGA=
github.com/longhorn/go-common-libs v0.0.0-20240821134112-907f57efd48f h1:hjqUs3WVodkzrWwlUMVsnKAlom3uohoNlhZBGLsRvQY=
github.com/longhorn/go-common-libs v0.0.0-20240821134112-907f57efd48f/go.mod h1:Qv34svr/msf6XoUwnrltNBTwMhQljbHEhb5ZKWiRdxo=
github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/moby/sys/mountinfo v0.7.1 h1:/tTvQaSJRr2FshkhXiIpux6fQ2Zvc4j7tAhMTStAG2g=
Expand Down
2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ github.com/kr/pretty
# github.com/kr/text v0.2.0
## explicit
github.com/kr/text
# github.com/longhorn/go-common-libs v0.0.0-20240811024046-b6ddc3efb72e
# github.com/longhorn/go-common-libs v0.0.0-20240821134112-907f57efd48f
## explicit; go 1.22.0
github.com/longhorn/go-common-libs/backup
# github.com/matttproud/golang_protobuf_extensions v1.0.1
Expand Down