From 77964211b3ca7f445a3417ba768878dcd7a4971c Mon Sep 17 00:00:00 2001 From: Michael Quigley Date: Wed, 25 Oct 2023 14:16:18 -0400 Subject: [PATCH] sdk fixes to re-instate reserved share metadata (#427) --- cmd/zrok/reserve.go | 1 + sdk/model.go | 1 + sdk/share.go | 1 + 3 files changed, 3 insertions(+) diff --git a/cmd/zrok/reserve.go b/cmd/zrok/reserve.go index 69e6ecf5..b6be848d 100644 --- a/cmd/zrok/reserve.go +++ b/cmd/zrok/reserve.go @@ -87,6 +87,7 @@ func (cmd *reserveCommand) run(_ *cobra.Command, args []string) { } req := &sdk.ShareRequest{ + Reserved: true, BackendMode: sdk.BackendMode(cmd.backendMode), ShareMode: shareMode, BasicAuth: cmd.basicAuth, diff --git a/sdk/model.go b/sdk/model.go index cefb1eb0..4c27ecd9 100644 --- a/sdk/model.go +++ b/sdk/model.go @@ -20,6 +20,7 @@ const ( ) type ShareRequest struct { + Reserved bool BackendMode BackendMode ShareMode ShareMode Target string diff --git a/sdk/share.go b/sdk/share.go index 9a1838b8..45feb57f 100644 --- a/sdk/share.go +++ b/sdk/share.go @@ -25,6 +25,7 @@ func CreateShare(root env_core.Root, request *ShareRequest) (*Share, error) { default: return nil, errors.Errorf("unknown share mode '%v'", request.ShareMode) } + out.Body.Reserved = request.Reserved if len(request.BasicAuth) > 0 { out.Body.AuthScheme = string(Basic)