Skip to content

Commit

Permalink
v1: add policyID to compose request to composer
Browse files Browse the repository at this point in the history
The policy ID will be added to the RHSM facts, allowing the compliance
service to tie instances to the specified compliance policy.
  • Loading branch information
croissanne committed Sep 9, 2024
1 parent cd806cc commit 02aeb86
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 4 deletions.
16 changes: 12 additions & 4 deletions internal/clients/composer/openapi.v2.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions internal/clients/composer/openapi.v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -975,6 +975,12 @@ components:
required:
- profile_id
properties:
policy_id:
type: string
format: uuid
description: |
Puts a specified policy ID in the RHSM facts, so that any instances registered to
insights will be automatically connected to the compliance policy in the console.
profile_id:
type: string
tailoring:
Expand All @@ -986,6 +992,12 @@ components:
required:
- profile_id
properties:
policy_id:
type: string
format: uuid
description: |
Puts a specified policy ID in the RHSM facts, so that any instances registered to
insights will be automatically connected to the compliance policy in the console.
profile_id:
type: string
datastream:
Expand Down
1 change: 1 addition & 0 deletions internal/v1/handler_compose_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,7 @@ func (h *Handlers) buildCustomizations(ctx echo.Context, cr *ComposeRequest, d *

res.Openscap = &composer.OpenSCAP{
ProfileId: pdata.ProfileID,
PolicyId: &policy.PolicyId,
JsonTailoring: &composer.OpenSCAPJSONTailoring{
ProfileId: pdata.ProfileID,
Filepath: "/etc/osbuild/openscap-tailoring.json",
Expand Down
1 change: 1 addition & 0 deletions internal/v1/handler_post_compose_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2492,6 +2492,7 @@ func TestComposeCustomizations(t *testing.T) {
Customizations: &composer.Customizations{
Openscap: &composer.OpenSCAP{
ProfileId: "openscap-ref-id",
PolicyId: &policyID,
JsonTailoring: &composer.OpenSCAPJSONTailoring{
ProfileId: "openscap-ref-id",
Filepath: "/etc/osbuild/openscap-tailoring.json",
Expand Down

0 comments on commit 02aeb86

Please sign in to comment.