Skip to content

Commit

Permalink
internal/v1: expose contenturl and rhsm ostree options
Browse files Browse the repository at this point in the history
  • Loading branch information
croissanne committed Nov 4, 2022
1 parent 2d51d4f commit 1a96ac3
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 85 deletions.
152 changes: 82 additions & 70 deletions internal/v1/api.go

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

11 changes: 11 additions & 0 deletions internal/v1/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,11 @@ components:
properties:
url:
type: string
contenturl:
type: string
description: |
A URL which, if set, is used for fetching content. Implies that `url` is set as well,
which will be used for metadata only.
ref:
type: string
example: 'rhel/8/x86_64/edge'
Expand All @@ -741,6 +746,12 @@ components:
02604b2da6e954bd34b8b82a835e5a77d2b60ffa), or a branch-like
reference (example: rhel/8/x86_64/edge)
example: 'rhel/8/x86_64/edge'
rhsm:
type: boolean
description: |
Determines whether a valid subscription manager (candlepin) identity is required to
access this repository. Consumer certificates will be used as client certificates when
fetching metadata and content.
PackagesResponse:
type: object
required:
Expand Down
14 changes: 5 additions & 9 deletions internal/v1/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -645,15 +645,11 @@ func buildOSTreeOptions(ostreeOptions *OSTree) *composer.OSTree {

cloudOptions := new(composer.OSTree)
if ostreeOptions != nil {
if ref := ostreeOptions.Ref; ref != nil {
cloudOptions.Ref = ref
}
if url := ostreeOptions.Url; url != nil {
cloudOptions.Url = url
}
if parent := ostreeOptions.Parent; parent != nil {
cloudOptions.Parent = parent
}
cloudOptions.Ref = ostreeOptions.Ref
cloudOptions.Url = ostreeOptions.Url
cloudOptions.Contenturl = ostreeOptions.Contenturl
cloudOptions.Parent = ostreeOptions.Parent
cloudOptions.Rhsm = ostreeOptions.Rhsm
}
return cloudOptions
}
Expand Down
16 changes: 10 additions & 6 deletions internal/v1/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1232,9 +1232,11 @@ func TestComposeCustomizations(t *testing.T) {
Architecture: "x86_64",
ImageType: ImageTypesRhelEdgeCommit,
Ostree: &OSTree{
Ref: strptr("test/edge/ref"),
Url: strptr("https://ostree.srv/"),
Parent: strptr("test/edge/ref2"),
Ref: strptr("test/edge/ref"),
Url: strptr("https://ostree.srv/"),
Contenturl: strptr("https://ostree.srv/content"),
Parent: strptr("test/edge/ref2"),
Rhsm: common.BoolToPtr(true),
},
UploadRequest: UploadRequest{
Type: UploadTypesAwsS3,
Expand All @@ -1261,9 +1263,11 @@ func TestComposeCustomizations(t *testing.T) {
Architecture: "x86_64",
ImageType: composer.ImageTypesEdgeCommit,
Ostree: &composer.OSTree{
Ref: strptr("test/edge/ref"),
Url: strptr("https://ostree.srv/"),
Parent: strptr("test/edge/ref2"),
Ref: strptr("test/edge/ref"),
Url: strptr("https://ostree.srv/"),
Contenturl: strptr("https://ostree.srv/content"),
Parent: strptr("test/edge/ref2"),
Rhsm: common.BoolToPtr(true),
},
Repositories: []composer.Repository{

Expand Down

0 comments on commit 1a96ac3

Please sign in to comment.