-
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
RHEL-14922: accept a config blob alongside the "changes" slice when committing #20657
Conversation
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.
just some drive by comments
pkg/bindings/containers/types.go
Outdated
@@ -29,6 +29,7 @@ type LogOptions struct { | |||
type CommitOptions struct { | |||
Author *string | |||
Changes []string | |||
Config []byte |
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 think it would make more sense to accepts an io.Reader here instead.
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.
Had to make it a *io.Reader
to make the generator happy.
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.
Yeah I think the generator could use some improvements, IMO a pointer to a interface makes things harder to use and more likely to cause nil derefs.
Anyway this shouldn't really block your work.
@@ -164,6 +164,7 @@ type ContainerStatReport struct { | |||
type CommitOptions struct { | |||
Author string | |||
Changes []string | |||
Config []byte |
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.
also io.Reader here.
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.
Had to make it a *io.Reader
to make the generator happy.
pkg/bindings/containers/commit.go
Outdated
if config := params.Get("config"); config != "" { | ||
requestBody = strings.NewReader(config) | ||
params.Del("config") | ||
} |
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.
you can add schema:"-"
to the type then it will not be added via ToParams()
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.
Ah, thanks, I wouldn't have guessed that.
88dcb4f
to
130fe7f
Compare
/override Build Each Commit |
@nalind: /override requires failed status contexts, check run or a prowjob name to operate on.
Only the following failed contexts/checkruns were expected:
If you are trying to override a checkrun that has a space in it, you must put a double quote on the context. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/override "Build Each Commit" |
@nalind: Overrode contexts on behalf of nalind: Build Each Commit In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
a011559
to
8b7478b
Compare
/retitle RHEL-14922: accept a config blob alongside the "changes" slice when committing |
8b7478b
to
ea7b1de
Compare
pkg/domain/entities/containers.go
Outdated
@@ -164,6 +164,7 @@ type ContainerStatReport struct { | |||
type CommitOptions struct { | |||
Author string | |||
Changes []string | |||
Config io.Reader |
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 struct is used for the REST API as well - will this break given that io.Reader can't really be serialized over the network?
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.
Changed it back to a []byte
.
77c513a
to
08c51ea
Compare
Ephemeral COPR build failed. @containers/packit-build please check. |
LGTM |
@@ -36,6 +36,11 @@ Apply the following possible instructions to the created image: | |||
|
|||
Can be set multiple times. | |||
|
|||
#### **--config**=*ConfigBlobFile* | |||
|
|||
Merge the JSON-encoded container configuration from the specified file into the configuration for the image |
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 we point users to a specification of the configuration?
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.
It varies between OCI and Docker image formats. I don't think there's a stable location to point to for the Docker config blob format (the engine API documentation is close, but it includes the API version number) , and the OCI version is missing some interesting fields. If it wasn't being exercised in tests that I'm about to add, I could pretty easily be talked into dropping the option.
Actually, maybe even after I add the tests to the PR....
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.
Well, as written, it's a JSON-encoded copy of the structure defined at https://github.com/containers/image/blob/main/manifest/docker_schema2.go#L67. Would a pointer to that be useful enough to someone who hasn't spent time staring at that code at some point already?
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.
Great idea, thanks @nalind
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.
Okay, added. Pointed at the currently-newest tag instead of main
in case the line number changes.
bd40243
to
7289285
Compare
…tting Use ParseUserNamespace instead of ParseNamespace to parse a passed-in user namespace setting. Signed-off-by: Nalin Dahyabhai <[email protected]>
When committing containers to create new images, accept a container config blob being passed in the body of the API request by adding a Config field to our API structures. Populate it from the body of requests that we receive, and use its contents as the body of requests that we make. Make the libpod commit endpoint split changes values at newlines, just like the compat endpoint does. Pass both the config blob and the "changes" slice to buildah's Commit() API, so that it can handle cases where they overlap or conflict. Signed-off-by: Nalin Dahyabhai <[email protected]>
7289285
to
dbbe72e
Compare
Changed a line in the description of the |
Be specific that the `-v` flag only affects RUN instructions. The previous wording left it ambiguous, and people might have concluded that it applied to ADD and COPY as well. Signed-off-by: Nalin Dahyabhai <[email protected]>
dbbe72e
to
fa0aa91
Compare
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nalind, rhatdan 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 |
/cherry-pick v4.9.1-rhel |
@nalind: new pull request created: #21547 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/cherry-pick v4.9 |
@nalind: new pull request created: #21549 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Does this PR introduce a user-facing change?
Fixes #13770.