osbuild: add rpm-ostree stage
This adds the wrapper object and a simple test for the rpm-ostree stage. See the osbuild documentation for details. Signed-off-by: Tom Gundersen <teg@jklm.no>
This commit is contained in:
parent
1c9cb20b77
commit
a544fa7eb6
3 changed files with 32 additions and 0 deletions
16
internal/osbuild/rpm_ostree_stage.go
Normal file
16
internal/osbuild/rpm_ostree_stage.go
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
package osbuild
|
||||
|
||||
// The RPM-OSTree stage describes how to transform the imgae into an OSTree.
|
||||
type RPMOSTreeStageOptions struct {
|
||||
EtcGroupMembers []string `json:"etc_group_members,omitempty"`
|
||||
}
|
||||
|
||||
func (RPMOSTreeStageOptions) isStageOptions() {}
|
||||
|
||||
// NewLocaleStage creates a new Locale Stage object.
|
||||
func NewRPMOSTreeStage(options *RPMOSTreeStageOptions) *Stage {
|
||||
return &Stage{
|
||||
Name: "org.osbuild.rpm-ostree",
|
||||
Options: options,
|
||||
}
|
||||
}
|
||||
|
|
@ -62,6 +62,8 @@ func (stage *Stage) UnmarshalJSON(data []byte) error {
|
|||
options = new(FirewallStageOptions)
|
||||
case "org.osbuild.rpm":
|
||||
options = new(RPMStageOptions)
|
||||
case "org.osbuild.rpm-ostree":
|
||||
options = new(RPMOSTreeStageOptions)
|
||||
case "org.osbuild.systemd":
|
||||
options = new(SystemdStageOptions)
|
||||
case "org.osbuild.script":
|
||||
|
|
|
|||
|
|
@ -195,6 +195,20 @@ func TestStage_UnmarshalJSON(t *testing.T) {
|
|||
data: []byte(`{"name":"org.osbuild.rpm","options":{"gpgkeys":["key1","key2"],"packages":["checksum1","checksum2"]}}`),
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "rpm-ostree",
|
||||
fields: fields{
|
||||
Name: "org.osbuild.rpm-ostree",
|
||||
Options: &RPMOSTreeStageOptions{
|
||||
EtcGroupMembers: []string{
|
||||
"wheel",
|
||||
},
|
||||
},
|
||||
},
|
||||
args: args{
|
||||
data: []byte(`{"name":"org.osbuild.rpm-ostree","options":{"etc_group_members":["wheel"]}}`),
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "script",
|
||||
fields: fields{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue