From 0db184fb08d2cc41281e4d15d82aed8e5f9fb7ad Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Tue, 15 Mar 2022 13:58:55 +0100 Subject: [PATCH 1/2] fix breaking change in pkg/bindings pkg/bindings is considered stable. We cannot make changes that would break any users. If someone uses this field their code would fail to compile. Since the fix is obviously correct we will keep it but also add the old field back in to keep compatibility with old code. When both fields are set ImportArchive is preferred over ImportAchive. Fixes changes from commit 217197340c8f [NO NEW TESTS NEEDED] Signed-off-by: Paul Holzinger --- pkg/bindings/containers/checkpoint.go | 9 +++++++- pkg/bindings/containers/types.go | 23 ++++++++++++------- .../containers/types_restore_options.go | 15 ++++++++++++ 3 files changed, 38 insertions(+), 9 deletions(-) diff --git a/pkg/bindings/containers/checkpoint.go b/pkg/bindings/containers/checkpoint.go index 84590d052c..bcb9444886 100644 --- a/pkg/bindings/containers/checkpoint.go +++ b/pkg/bindings/containers/checkpoint.go @@ -79,7 +79,14 @@ func Restore(ctx context.Context, nameOrID string, options *RestoreOptions) (*en // Open the to-be-imported archive if needed. var r io.Reader - if i := options.GetImportArchive(); i != "" { + i := options.GetImportArchive() + if i == "" { + // backwards compat, ImportAchive is a typo but we still have to + // support this to avoid breaking users + // TODO: remove ImportAchive with 5.0 + i = options.GetImportAchive() + } + if i != "" { params.Set("import", "true") r, err = os.Open(i) if err != nil { diff --git a/pkg/bindings/containers/types.go b/pkg/bindings/containers/types.go index 3c8b1eefa3..c87f82bf41 100644 --- a/pkg/bindings/containers/types.go +++ b/pkg/bindings/containers/types.go @@ -64,14 +64,21 @@ type RestoreOptions struct { IgnoreVolumes *bool IgnoreStaticIP *bool IgnoreStaticMAC *bool - ImportArchive *string - Keep *bool - Name *string - TCPEstablished *bool - Pod *string - PrintStats *bool - PublishPorts []string - FileLocks *bool + // ImportAchive is the path to an archive which contains the checkpoint data. + // + // Deprecated: Use ImportArchive instead. This field name is a typo and + // will be removed in a future major release. + ImportAchive *string + // ImportArchive is the path to an archive which contains the checkpoint data. + // ImportArchive is preferred over ImportAchive when both are set. + ImportArchive *string + Keep *bool + Name *string + TCPEstablished *bool + Pod *string + PrintStats *bool + PublishPorts []string + FileLocks *bool } //go:generate go run ../generator/generator.go CreateOptions diff --git a/pkg/bindings/containers/types_restore_options.go b/pkg/bindings/containers/types_restore_options.go index e8a0e236c0..b1b14a7042 100644 --- a/pkg/bindings/containers/types_restore_options.go +++ b/pkg/bindings/containers/types_restore_options.go @@ -77,6 +77,21 @@ func (o *RestoreOptions) GetIgnoreStaticMAC() bool { return *o.IgnoreStaticMAC } +// WithImportAchive set field ImportAchive to given value +func (o *RestoreOptions) WithImportAchive(value string) *RestoreOptions { + o.ImportAchive = &value + return o +} + +// GetImportAchive returns value of field ImportAchive +func (o *RestoreOptions) GetImportAchive() string { + if o.ImportAchive == nil { + var z string + return z + } + return *o.ImportAchive +} + // WithImportArchive set field ImportArchive to given value func (o *RestoreOptions) WithImportArchive(value string) *RestoreOptions { o.ImportArchive = &value From 33aa2f2d1c8476a973d83dfefacbb60a36d8d4b1 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Tue, 15 Mar 2022 17:33:34 +0100 Subject: [PATCH 2/2] Fix windows win-sshproxy build Github no longer supports the unauthenticated git protocol, so switch to using https instead. https://github.blog/2021-09-01-improving-git-protocol-security-github/ Signed-off-by: Paul Holzinger --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ae13d61341..3755863707 100644 --- a/Makefile +++ b/Makefile @@ -192,7 +192,7 @@ endif # dependencies. This is only used for the Windows installer task (podman.msi), which must # include this lightweight helper binary. # -GV_GITURL=git://github.com/containers/gvisor-tap-vsock.git +GV_GITURL=https://github.com/containers/gvisor-tap-vsock.git GV_SHA=e943b1806d94d387c4c38d96719432d50a84bbd0 ###