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)
}