-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remote: fix manifest add --annotation #16004
remote: fix manifest add --annotation #16004
Conversation
@vrothberg @Luap99 PTAL |
@@ -36,7 +36,7 @@ type ManifestAddOptions struct { | |||
// ManifestAnnotateOptions provides model for annotating manifest list | |||
type ManifestAnnotateOptions struct { | |||
// Annotation to add to manifest list | |||
Annotation []string `json:"annotation" schema:"annotation"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Luap99 This'd be a breaking change, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be OK. pkg/domain/entities
is an internal package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No this is breaking the rest API, the structs in pkg/domain/entities
are sometimes used in the API to unmarshal the query.
see
podman/pkg/domain/entities/manifest.go
Lines 18 to 19 in 226977f
type ManifestAddOptions struct { | |
ManifestAnnotateOptions |
podman/pkg/domain/entities/manifest.go
Lines 63 to 65 in 226977f
type ManifestModifyOptions struct { | |
Operation string `json:"operation" schema:"operation"` // Valid values: update, remove, annotate | |
ManifestAddOptions |
which is then parsed in
podman/pkg/api/handlers/libpod/manifests.go
Lines 435 to 436 in 226977f
body := new(entities.ManifestModifyOptions) | |
if err := json.NewDecoder(r.Body).Decode(body); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your review.
I'll think about other methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed it.
Add an Annotations
field while keeping an Annotate
Field.
Because of Decode() fails to unmarshal.
aa70e57
to
4e5afd0
Compare
@vrothberg @Luap99 where are we on this one? |
4e5afd0
to
f2d3378
Compare
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mheon, sstosh The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
pkg/domain/entities/manifest.go
Outdated
@@ -43,6 +43,8 @@ type ManifestAddOptions struct { | |||
type ManifestAnnotateOptions struct { | |||
// Annotation to add to manifest list | |||
Annotation []string `json:"annotation" schema:"annotation"` | |||
// Annotation to add to manifest list by a map |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add that annotations
is preferred over annotation
to the comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
f2d3378
to
f807b67
Compare
* `manifest add --annotation option` adds annotations field on remote environment. * `manifest inspect` prints annotations field on remote environment. Fixes: containers#15952 Signed-off-by: Toshiki Sonoda <[email protected]>
@containers/podman-maintainers PTAL |
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Thank you!
manifest add --annotation option
adds annotations field on remote environment.manifest inspect
prints annotations field on remote environment.Fixes: #15952
Signed-off-by: Toshiki Sonoda [email protected]
This PR is related to #15988.
Does this PR introduce a user-facing change?