-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Create --append
flag to add file to existing artifact using podman artifact add
command
#25179
base: main
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Honny1 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
a23f466
to
1619f7f
Compare
pkg/libartifact/artifact.go
Outdated
// TODO Here we have to assume only a single manifest for the artifact; this will | ||
// need to evolve |
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.
FYI, talked with @baude about this I will open a PR later to just make it always use one manifest instead of the array as this simplifies a lot of things for all of us I think.
I can do this before your PR here or after, depending on how you prefer it.
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 do it before. Please let me know when the PR is ready.
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.
Sure I will work on it Monday
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.
test/e2e/common_test.go
Outdated
func modifyArtifactFile(path string, newNumBytes int64) error { | ||
dir, last := filepath.Split(path) | ||
session := podmanTest.Podman([]string{"run", "-v", fmt.Sprintf("%s:/artifacts:z", dir), ALPINE, "dd", "if=/dev/urandom", fmt.Sprintf("of=%s", filepath.Join("/artifacts", last)), "bs=1b", fmt.Sprintf("count=%d", newNumBytes)}) | ||
session.WaitWithDefaultTimeout() | ||
if session.ExitCode() != 0 { | ||
return errors.New("unable to generate artifact file") | ||
} | ||
return 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.
This seems extremely wasteful to run container for this.
You can just create random byte sin go, i.e. math/rand
and write them to the file.
Allowing for multiple manifest per artifact just makes the code and cli design harder to work with it. It is not clear how mounting, extracting or edit on a multi manifest artifact should have worked. A single manifest should make the code much easier to work with. Signed-off-by: Paul Holzinger <[email protected]>
1619f7f
to
1e16026
Compare
Fixes: https://issues.redhat.com/browse/RUN-2444 Signed-off-by: Jan Rodák <[email protected]>
1e16026
to
cc2a56e
Compare
This PR creates a
--append
flag to add a file to an existing artifact using thepodman artifact add
command.Fixes: https://issues.redhat.com/browse/RUN-2444
Does this PR introduce a user-facing change?