-
Notifications
You must be signed in to change notification settings - Fork 54
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
imagefilter: add ResultFormatter
type to support flexible output
#1019
Conversation
Name string `json:"name"` | ||
} | ||
|
||
type filteredResultJSON struct { |
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.
We need to decide a bit how much we want to expose here, it will become an API so I started very minimal, I played with this a bit and added everything in 37c0921 just to see what it would look like. The result is something like:
{
"distro": {
"name": "rhel-10.0",
"Codename": "",
"Releasever": "10",
"OsVersion": "10.0",
"ModulePlatformID": "platform:el10",
"Product": "Red Hat Enterprise Linux",
"OSTreeRef": "rhel/10/%s/edge"
},
"arch": {
"name": "x86_64"
},
"image_type": {
"name": "vmdk",
"bootmode": "hybrid",
"filename": "disk.vmdk",
"MIMEType": "application/x-vmdk",
"OSTreeRef": "",
"ISOLabel": "",
"Size": 1,
"PartitionType": "gpt",
"BuildPipelines": [
"build"
],
"PayloadPipelines": [
"os",
"image",
"vmdk"
],
"PayloadPackageSets": [
"blueprint"
],
"Exports": [
"vmdk"
]
}
},
{
"distro": {
"name": "rhel-10.0",
"Codename": "",
"Releasever": "10",
"OsVersion": "10.0",
"ModulePlatformID": "platform:el10",
"Product": "Red Hat Enterprise Linux",
"OSTreeRef": "rhel/10/%s/edge"
},
"arch": {
"name": "x86_64"
},
"image_type": {
"name": "wsl",
"bootmode": "none",
"filename": "disk.tar.gz",
"MIMEType": "application/x-tar",
"OSTreeRef": "",
"ISOLabel": "",
"Size": 1,
"PartitionType": "",
"BuildPipelines": [
"build"
],
"PayloadPipelines": [
"os",
"archive"
],
"PayloadPackageSets": [
"blueprint"
],
"Exports": [
"archive"
]
}
}
...
(just to give a flavor what is there)
[edit: fixed a bug in the generation]
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.
Add a few config parameters and package lists to this and we have a good way to "dump" image definitions in a portable way ^_^
f574956
to
21b1ec1
Compare
This commit adds a new `ResultFormatter` interface that supports outputing the results as text or JSON. Note that the text output should be copy/paste friendly, i.e. the "image-builder" cmdline (or other consuemrs) should support: ``` $ image-builder manifest centos-9 type:qcow2 arch:s390 $ image-builder build centos-9 type:qcow2 arch:x86_64 ``` (and of course `build` will need to error there is an architecture mistach like host-arch != target-arch).
21b1ec1
to
ff00f63
Compare
This commit adds a new
ResultFormatter
interface that supportsoutputing the results as text or JSON.
(this is another splitout from #997)