mirror of
https://github.com/containers/podman.git
synced 2025-06-22 09:58:10 +08:00
bindings: add manifest should follow es_model while marshalling OSVersion and OSFeatures
It seems API needs json names for OSVersion and OSFeatures in es_model ref: https://github.com/containers/podman/blob/main/pkg/domain/entities/manifest.go#L42 So at bindings end ensure that we honor es_model naming convention when we perform marshalling otherwise API will ignore these fields Signed-off-by: Aditya R <arajan@redhat.com>
This commit is contained in:
@ -51,8 +51,10 @@ type ModifyOptions struct {
|
||||
Features []string // Feature list for the image
|
||||
Images []string // Images is an optional list of images to add/remove to/from manifest list depending on operation
|
||||
OS *string // OS overrides the operating system for the image
|
||||
OSFeatures []string // OS features for the image
|
||||
OSVersion *string // OSVersion overrides the operating system for the image
|
||||
// OS features for the image
|
||||
OSFeatures []string `json:"os_features" schema:"os_features"`
|
||||
// OSVersion overrides the operating system for the image
|
||||
OSVersion *string `json:"os_version" schema:"os_version"`
|
||||
Variant *string // Variant overrides the operating system variant for the image
|
||||
Authfile *string
|
||||
Password *string
|
||||
|
@ -122,13 +122,13 @@ func (o *ModifyOptions) GetOS() string {
|
||||
return *o.OS
|
||||
}
|
||||
|
||||
// WithOSFeatures set oS features for the image
|
||||
// WithOSFeatures set field OSFeatures to given value
|
||||
func (o *ModifyOptions) WithOSFeatures(value []string) *ModifyOptions {
|
||||
o.OSFeatures = value
|
||||
return o
|
||||
}
|
||||
|
||||
// GetOSFeatures returns value of oS features for the image
|
||||
// GetOSFeatures returns value of field OSFeatures
|
||||
func (o *ModifyOptions) GetOSFeatures() []string {
|
||||
if o.OSFeatures == nil {
|
||||
var z []string
|
||||
@ -137,13 +137,13 @@ func (o *ModifyOptions) GetOSFeatures() []string {
|
||||
return o.OSFeatures
|
||||
}
|
||||
|
||||
// WithOSVersion set oSVersion overrides the operating system for the image
|
||||
// WithOSVersion set field OSVersion to given value
|
||||
func (o *ModifyOptions) WithOSVersion(value string) *ModifyOptions {
|
||||
o.OSVersion = &value
|
||||
return o
|
||||
}
|
||||
|
||||
// GetOSVersion returns value of oSVersion overrides the operating system for the image
|
||||
// GetOSVersion returns value of field OSVersion
|
||||
func (o *ModifyOptions) GetOSVersion() string {
|
||||
if o.OSVersion == nil {
|
||||
var z string
|
||||
|
@ -91,6 +91,27 @@ var _ = Describe("Podman manifest", func() {
|
||||
Expect(session.OutputToString()).To(ContainSubstring(imageListARM64InstanceDigest))
|
||||
})
|
||||
|
||||
It("add with new version", func() {
|
||||
// Following test must pass for both podman and podman-remote
|
||||
session := podmanTest.Podman([]string{"manifest", "create", "foo"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
id := strings.TrimSpace(string(session.Out.Contents()))
|
||||
|
||||
session = podmanTest.Podman([]string{"manifest", "inspect", id})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
|
||||
session = podmanTest.Podman([]string{"manifest", "add", "--os-version", "7.7.7", "foo", imageListInstance})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
|
||||
session = podmanTest.Podman([]string{"manifest", "inspect", "foo"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session.OutputToString()).To(ContainSubstring("7.7.7"))
|
||||
})
|
||||
|
||||
It("tag", func() {
|
||||
session := podmanTest.Podman([]string{"manifest", "create", "foobar"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
|
Reference in New Issue
Block a user