mirror of
https://github.com/garethgeorge/backrest.git
synced 2025-12-17 02:55:39 +00:00
fix: make instance ID required field
This commit is contained in:
@@ -6,7 +6,6 @@ import (
|
||||
|
||||
v1 "github.com/garethgeorge/backrest/gen/go/v1"
|
||||
"github.com/garethgeorge/backrest/pkg/restic"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
// ValidateOperation verifies critical properties of the operation proto.
|
||||
@@ -24,7 +23,7 @@ func ValidateOperation(op *v1.Operation) error {
|
||||
return errors.New("operation.plan_id is required")
|
||||
}
|
||||
if op.InstanceId == "" {
|
||||
zap.L().Warn("operation.instance_id should typically be set")
|
||||
return errors.New("operation.instance_id is required")
|
||||
}
|
||||
if op.SnapshotId != "" {
|
||||
if err := restic.ValidateSnapshotId(op.SnapshotId); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user