-
Notifications
You must be signed in to change notification settings - Fork 2.9k
quadlet install: add support for multiple quadlets in a single file #27384
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
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: flouthoc 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 |
6a18d3d to
8ea91d2
Compare
|
[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore. |
6688c20 to
1ea3992
Compare
|
The title of the PR and the release notes comment are misleading. This PR does not add this capability to Quadlet, it adds it to |
1ea3992 to
f90c8a5
Compare
I agree this is only applicable for |
|
Please add the issue link with
Just to be clear I am still against doing this overall but I guess I was outvoted on that so that doesn't matter. |
3ceac95 to
3efc462
Compare
| // parseMultiQuadletFile parses a file that may contain multiple quadlets separated by "---" | ||
| // Returns a slice of quadletSection structs, each representing a separate quadlet | ||
| func parseMultiQuadletFile(filePath string) ([]quadletSection, error) { | ||
| content, err := os.ReadFile(filePath) |
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 you have already read the file in isMultiQuadletFile(toInstall) prior. Would it make sense to load the file into an array or some other data structure in isMultiQuadletFile() to avoid another read 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.
This function is removed.
|
@Luap99 I completely agree with you. But, I kinda disengaged from the |
|
@ygalblum there was an internal design doc https://docs.google.com/document/d/1fVjmxVA6k_83iVztQ4j4ISGW7JMVb7yCBfO6vYk9SWs/edit?usp=sharing If that wasn't shared to you then this is already a big issue as you as main quadlet maintainer should be able to look at these things and give your input. As I noted there design docs shouldn't be internal at all and be public in this repo so all maintainers and community people can actually give feedback https://github.com/containers/podman/tree/main/contrib/design-docs which was also not done here.
Well the way I see it decided "somewhere" doesn't count in general, we decide upstream on github what gets merged which includes all maintainers including you of course. So if you think this is a bad idea you can still speak up. I already objected that feature internally and on the issue (#26447) but it seemed like some other maintainers on the team were in favour and others abstained so I didn't push any further against this. |
I clicked the link and landed on a web page saying: There is also a text input field Is the document only for internal use? There is button to click for |
Honny1
left a 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.
My only thought is that we could improve performance by reading the input file only once instead of multiple times.
There is no reason why this should be private IMO. I don't own the doc so I cannot share it. As I said for feedback and public knowledge this should have been posted here on github into the design-doc directory instead of being a private doc. There have been a ton of design docs internally over the years. I am trying to push all to do these discussions in public here on github for transparency and to allow for feedback outside our team early on in the design phase. |
|
I don't have access to this doc either. I remember the discussion we had on Quadlet's support for single file and I agree that Quadlet should not support it. Generally speaking about To me, the |
That is a good idea. |
@ygalblum You should have access to design doc now.
I agree, I think we can limit this to one particular extension maybe like |
3efc462 to
5e8c0b9
Compare
3e5da4c to
5c6f512
Compare
e394f15 to
03e35a0
Compare
pkg/domain/infra/abi/quadlet.go
Outdated
| isQuadletsFile := ext == ".quadlets" | ||
|
|
||
| // Only check for multi-quadlet content if it's a .quadlets file | ||
| var isMulti bool | ||
| if isQuadletsFile { | ||
| // For .quadlets files, always treat as multi-quadlet (even single quadlets) | ||
| isMulti = true | ||
| } |
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 isMulti always has the same value as isQuadletsFile.
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.
Enable installing multiple quadlets from one file using '---' delimiters. Each section requires '# FileName=<name>' comment for custom naming. Single quadlet files remain unchanged for backward compatibility. Assited by: claude-4-sonnet Signed-off-by: flouthoc <[email protected]>
Quadlets installed from `.quadlet` file now belongs to a single application, anyone file removed from this application removes all the other files as well. Assited by: claude-4-sonnet Signed-off-by: flouthoc <[email protected]>
03e35a0 to
a1501c4
Compare
|
@Honny1 PTAL |
Honny1
left a 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.
LGTM
Add ability to
quadlet installto install multiple quadlets from a single file by separatingthem with
---delimiters, similar to how multiple quadlets can beinstalled from a directory. Each section requires
# FileName=<name>comment for custom naming.Example usage:
Does this PR introduce a user-facing change?