osbuild{1,2}: new stages in unmarshal method

Recently added stages org.osbuild.sysconfig and
org.osbuild.kernel-cmdline were missing from the Manifest unmarshal
method causing it to fail when trying to unmarshal manifests that
contained them.
This commit is contained in:
Achilleas Koutsou 2021-02-24 18:51:28 +01:00 committed by Tom Gundersen
parent ce963004e0
commit 164faa7503
3 changed files with 12 additions and 2 deletions

View file

@ -30,7 +30,7 @@ func (sources *Sources) UnmarshalJSON(data []byte) error {
case "org.osbuild.files":
source = new(FilesSource)
default:
return errors.New("unexpected source name" + name)
return errors.New("unexpected source name: " + name)
}
err = json.Unmarshal(rawSource, source)
if err != nil {

View file

@ -70,6 +70,10 @@ func (stage *Stage) UnmarshalJSON(data []byte) error {
options = new(SystemdStageOptions)
case "org.osbuild.script":
options = new(ScriptStageOptions)
case "org.osbuild.sysconfig":
options = new(SysconfigStageOptions)
case "org.osbuild.kernel-cmdline":
options = new(KernelCmdlineStageOptions)
default:
return fmt.Errorf("unexpected stage name: %s", rawStage.Name)
}

View file

@ -97,6 +97,10 @@ func (stage *Stage) UnmarshalJSON(data []byte) error {
options = new(SystemdStageOptions)
case "org.osbuild.script":
options = new(ScriptStageOptions)
case "org.osbuild.sysconfig":
options = new(SysconfigStageOptions)
case "org.osbuild.kernel-cmdline":
options = new(KernelCmdlineStageOptions)
case "org.osbuild.rpm":
options = new(RPMStageOptions)
inputs = new(RPMStageInputs)
@ -109,8 +113,10 @@ func (stage *Stage) UnmarshalJSON(data []byte) error {
case "org.osbuild.ostree.pull":
options = new(OSTreePullStageOptions)
inputs = new(OSTreePullStageInputs)
case "org.osbuild.ostree.init":
options = new(OSTreeInitStageOptions)
case "org.osbuild.ostree.preptree":
options = new(RPMOSTreePrepTreeStageOptions)
options = new(OSTreePrepTreeStageOptions)
default:
return fmt.Errorf("unexpected stage type: %s", rawStage.Type)
}