weldr: Add support for PartitioningMode

This commit is contained in:
Brian C. Lane 2023-10-05 15:06:22 -07:00 committed by Ondřej Budai
parent 2729f6ac54
commit 81240f58ba
2 changed files with 17 additions and 3 deletions

View file

@ -2485,9 +2485,21 @@ func (api *API) composeHandler(writer http.ResponseWriter, request *http.Request
}
seed := bigSeed.Int64()
// Get the partitioning mode
pm, err := bp.Customizations.GetPartitioningMode()
if err != nil {
errors := responseError{
ID: "BlueprintsError",
Msg: err.Error(),
}
statusResponseError(writer, http.StatusBadRequest, errors)
return
}
options := distro.ImageOptions{
Size: size,
OSTree: &cr.OSTree,
Size: size,
OSTree: &cr.OSTree,
PartitioningMode: pm,
}
options.Facts = &facts.ImageOptions{
APIType: facts.WELDR_APITYPE,

View file

@ -550,7 +550,8 @@ func TestBlueprintsCustomizationInfoToml(t *testing.T) {
"openscap": {
"datastream": "/usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml",
"profile_id": "xccdf_org.ssgproject.content_profile_cis"
}
},
"partitioning_mode": "raw"
}
}`
resp := test.SendHTTP(api, true, "POST", "/api/v0/blueprints/new", testBlueprint)
@ -644,6 +645,7 @@ func TestBlueprintsCustomizationInfoToml(t *testing.T) {
DataStream: "/usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml",
ProfileID: "xccdf_org.ssgproject.content_profile_cis",
},
PartitioningMode: "raw",
},
}