Skip to content

Commit

Permalink
weldr: Add support for PartitioningMode
Browse files Browse the repository at this point in the history
  • Loading branch information
bcl authored and ondrejbudai committed Oct 23, 2023
1 parent 2729f6a commit 81240f5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
16 changes: 14 additions & 2 deletions internal/weldr/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 3 additions & 1 deletion internal/weldr/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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",
},
}

Expand Down

0 comments on commit 81240f5

Please sign in to comment.