-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15491 from marshall-lee/bindings-schema-ignore
Mark some of the option fields as ignored in pkg/bindings
- Loading branch information
Showing
10 changed files
with
90 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package bindings_test | ||
|
||
import ( | ||
"bytes" | ||
|
||
"github.com/containers/podman/v4/pkg/bindings/images" | ||
"github.com/containers/podman/v4/pkg/bindings/kube" | ||
"github.com/containers/podman/v4/pkg/bindings/manifests" | ||
. "github.com/onsi/ginkgo" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
var _ = Describe("Binding types", func() { | ||
It("serialize image pull options", func() { | ||
var writer bytes.Buffer | ||
opts := new(images.PullOptions).WithOS("foo").WithProgressWriter(&writer).WithSkipTLSVerify(true) | ||
params, err := opts.ToParams() | ||
Expect(err).ToNot(HaveOccurred()) | ||
Expect(params.Get("os")).To(Equal("foo")) | ||
Expect(params.Has("progresswriter")).To(BeFalse()) | ||
Expect(params.Has("skiptlsverify")).To(BeFalse()) | ||
}) | ||
|
||
It("serialize image push options", func() { | ||
var writer bytes.Buffer | ||
opts := new(images.PushOptions).WithAll(true).WithProgressWriter(&writer).WithSkipTLSVerify(true) | ||
params, err := opts.ToParams() | ||
Expect(err).ToNot(HaveOccurred()) | ||
Expect(params.Get("all")).To(Equal("true")) | ||
Expect(params.Has("progresswriter")).To(BeFalse()) | ||
Expect(params.Has("skiptlsverify")).To(BeFalse()) | ||
}) | ||
|
||
It("serialize image search options", func() { | ||
opts := new(images.SearchOptions).WithLimit(123).WithSkipTLSVerify(true) | ||
params, err := opts.ToParams() | ||
Expect(err).ToNot(HaveOccurred()) | ||
Expect(params.Get("limit")).To(Equal("123")) | ||
Expect(params.Has("skiptlsverify")).To(BeFalse()) | ||
}) | ||
|
||
It("serialize manifest modify options", func() { | ||
opts := new(manifests.ModifyOptions).WithOS("foo").WithSkipTLSVerify(true) | ||
params, err := opts.ToParams() | ||
Expect(err).ToNot(HaveOccurred()) | ||
Expect(params.Get("os")).To(Equal("foo")) | ||
Expect(params.Has("skiptlsverify")).To(BeFalse()) | ||
}) | ||
|
||
It("serialize manifest add options", func() { | ||
opts := new(manifests.AddOptions).WithAll(true).WithOS("foo").WithSkipTLSVerify(true) | ||
params, err := opts.ToParams() | ||
Expect(err).ToNot(HaveOccurred()) | ||
Expect(params.Get("all")).To(Equal("true")) | ||
Expect(params.Get("os")).To(Equal("foo")) | ||
Expect(params.Has("skiptlsverify")).To(BeFalse()) | ||
}) | ||
|
||
It("serialize kube play options", func() { | ||
opts := new(kube.PlayOptions).WithQuiet(true).WithSkipTLSVerify(true) | ||
params, err := opts.ToParams() | ||
Expect(err).ToNot(HaveOccurred()) | ||
Expect(params.Get("quiet")).To(Equal("true")) | ||
Expect(params.Has("skiptlsverify")).To(BeFalse()) | ||
}) | ||
}) |