Add podman-remote quadlet command#29088
Conversation
|
@Honny1 here's the new PR for quadlets after the app were added |
Honny1
left a comment
There was a problem hiding this comment.
I have some comments and also tried check some causes of failures.
| func (ic *ContainerEngine) QuadletPrint(_ context.Context, _ string) (string, error) { | ||
| return "", errNotImplemented | ||
| func downloadToTemp(fileURL string) (string, error) { | ||
| resp, err := http.Get(fileURL) //nolint:gosec,noctx |
There was a problem hiding this comment.
What if that file doesn't exist and it will get a 404 or 500?
There was a problem hiding this comment.
right, I will address it
| groups := groupByQuadletFile(allFiles) | ||
|
|
||
| for _, group := range groups { | ||
| installReport, err := quadlets.Install(ic.ClientCtx, group, options) |
There was a problem hiding this comment.
Well, is this right? Each call of this will trigger a systemd reload.
| if cd != "" { | ||
| const prefix = "filename=" | ||
| if idx := strings.Index(cd, prefix); idx != -1 { | ||
| filename := cd[idx+len(prefix):] | ||
| filename = strings.Trim(filename, "\"'") | ||
| if filename != "" { | ||
| return filename | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
What about using: mime.ParseMediaType(cd)
| return nil, nil, fmt.Errorf("cannot stat %s: %w", arg, err) | ||
| } | ||
| if info.IsDir() { | ||
| entries, err := os.ReadDir(arg) |
There was a problem hiding this comment.
Why not use filepath.WalkDir?
| QuadletErrors: make(map[string]error), | ||
| } | ||
|
|
||
| allFiles, cleanup, err := resolveInstallPaths(pathsOrURLs) |
There was a problem hiding this comment.
What if opts.Application is set and pathsOrURLs dir structure?
1a0be6f to
8fd8f35
Compare
|
addressed comments, pushed, error, rebased, pushed again |
Fixes: https://redhat.atlassian.net/browse/RUN-4852 Signed-off-by: Nicola Sella <nsella@redhat.com>
Fixes: https://redhat.atlassian.net/browse/RUN-4852
Checklist
Ensure you have completed the following checklist for your pull request to be reviewed:
commits. (
git commit -s). (If needed, usegit commit -s --amend). The author email must matchthe sign-off email address. See CONTRIBUTING.md
for more information.
Fixes: #00000in commit message (if applicable)make validatepr(format/lint checks)Noneif no user-facing changes)Does this PR introduce a user-facing change?