Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloud API: Add Fedora IoT bootable container #3916

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,12 @@ API:
RUNNER:
- aws/fedora-38-x86_64
- aws/fedora-39-x86_64
- IMAGE_TYPE: ["iot-bootable-container"]
RUNNER:
- aws/fedora-39-x86_64
ondrejbudai marked this conversation as resolved.
Show resolved Hide resolved
- aws/fedora-39-aarch64
- aws/fedora-40-x86_64
- aws/fedora-40-aarch64
- IMAGE_TYPE: ["aws"]
RUNNER:
- aws/rhel-8.8-ga-aarch64
Expand Down
5 changes: 5 additions & 0 deletions cmd/osbuild-composer/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ func GetDefaultConfig() *ComposerConfigFile {
"gce-rhui",
},
},
"fedora-*": {
ImageTypeDenyList: []string{
"iot-bootable-container",
},
},
},
},
DistroAliases: map[string]string{
Expand Down
11 changes: 9 additions & 2 deletions cmd/osbuild-composer/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ func TestDefaultConfig(t *testing.T) {
"gce-rhui",
},
},
"fedora-*": {
[]string{
"iot-bootable-container",
},
},
},
}

Expand Down Expand Up @@ -113,9 +118,11 @@ func TestWeldrDistrosImageTypeDenyList(t *testing.T) {
require.NoError(t, err)
require.NotNil(t, config)

// rhel config is overridden, but fedora is unaffected
expectedWeldrDistrosImageTypeDenyList := map[string][]string{
"*": {"qcow2", "vmdk"},
"rhel-84": {"qcow2"},
"*": {"qcow2", "vmdk"},
"fedora-*": {"iot-bootable-container"},
"rhel-84": {"qcow2"},
}

require.Equal(t, expectedWeldrDistrosImageTypeDenyList, config.weldrDistrosImageTypeDenyList())
Expand Down
2 changes: 2 additions & 0 deletions internal/cloudapi/v2/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,8 @@ func imageTypeFromApiImageType(it ImageTypes, arch distro.Arch) string {
return "rhel-edge-container"
case ImageTypesEdgeInstaller:
return "rhel-edge-installer"
case ImageTypesIotBootableContainer:
return "iot-bootable-container"
case ImageTypesIotCommit:
return "iot-commit"
case ImageTypesIotContainer:
Expand Down
30 changes: 17 additions & 13 deletions internal/cloudapi/v2/imagerequest.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,8 @@ func getDefaultTarget(imageType ImageTypes) (UploadTypes, error) {

case ImageTypesEdgeContainer:
fallthrough
case ImageTypesIotBootableContainer:
fallthrough
case ImageTypesIotContainer:
return UploadTypesContainer, nil

Expand Down Expand Up @@ -321,21 +323,23 @@ func targetSupportMap() map[UploadTypes]map[ImageTypes]bool {
ImageTypesAwsSapRhui: true,
},
UploadTypesAwsS3: {
ImageTypesGuestImage: true,
ImageTypesVsphere: true,
ImageTypesVsphereOva: true,
ImageTypesWsl: true,
ImageTypesImageInstaller: true,
ImageTypesEdgeInstaller: true,
ImageTypesIotInstaller: true,
ImageTypesLiveInstaller: true,
ImageTypesEdgeCommit: true,
ImageTypesIotCommit: true,
ImageTypesIotRawImage: true,
ImageTypesEdgeCommit: true,
ImageTypesEdgeInstaller: true,
ImageTypesGuestImage: true,
ImageTypesImageInstaller: true,
ImageTypesIotBootableContainer: true,
ImageTypesIotCommit: true,
ImageTypesIotInstaller: true,
ImageTypesIotRawImage: true,
ImageTypesLiveInstaller: true,
ImageTypesVsphereOva: true,
ImageTypesVsphere: true,
ImageTypesWsl: true,
},
UploadTypesContainer: {
ImageTypesEdgeContainer: true,
ImageTypesIotContainer: true,
ImageTypesEdgeContainer: true,
ImageTypesIotBootableContainer: true,
ImageTypesIotContainer: true,
},
UploadTypesGcp: {
ImageTypesGcp: true,
Expand Down
342 changes: 172 additions & 170 deletions internal/cloudapi/v2/openapi.v2.gen.go

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion internal/cloudapi/v2/openapi.v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -823,11 +823,12 @@ components:
- gcp-rhui
- guest-image
- image-installer
- iot-bootable-container
- iot-commit
- iot-container
- iot-installer
- iot-simplified-installer
- iot-raw-image
- iot-simplified-installer
- live-installer
- oci
- vsphere
Expand Down
3 changes: 2 additions & 1 deletion test/cases/api.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export IMAGE_TYPE_GUEST="guest-image"
export IMAGE_TYPE_OCI="oci"
export IMAGE_TYPE_VSPHERE="vsphere"
export IMAGE_TYPE_IOT_COMMIT="iot-commit"
export IMAGE_TYPE_IOT_BOOTABLE_CONTAINER="iot-bootable-container"

if (( $# > 2 )); then
echo "$0 does not support more than two arguments"
Expand Down Expand Up @@ -107,7 +108,7 @@ case ${IMAGE_TYPE} in
"$IMAGE_TYPE_OCI")
CLOUD_PROVIDER="${CLOUD_PROVIDER_OCI}"
;;
"$IMAGE_TYPE_EDGE_COMMIT"|"$IMAGE_TYPE_IOT_COMMIT"|"$IMAGE_TYPE_EDGE_INSTALLER"|"$IMAGE_TYPE_IMAGE_INSTALLER"|"$IMAGE_TYPE_GUEST"|"$IMAGE_TYPE_VSPHERE")
"$IMAGE_TYPE_EDGE_COMMIT"|"$IMAGE_TYPE_IOT_COMMIT"|"$IMAGE_TYPE_EDGE_INSTALLER"|"$IMAGE_TYPE_IMAGE_INSTALLER"|"$IMAGE_TYPE_GUEST"|"$IMAGE_TYPE_VSPHERE"|"$IMAGE_TYPE_IOT_BOOTABLE_CONTAINER")
# blobby image types: upload to s3 and provide download link
CLOUD_PROVIDER="${2:-$CLOUD_PROVIDER_AWS_S3}"
if [ "${CLOUD_PROVIDER}" != "${CLOUD_PROVIDER_AWS_S3}" ] && [ "${CLOUD_PROVIDER}" != "${CLOUD_PROVIDER_GENERIC_S3}" ]; then
Expand Down
2 changes: 1 addition & 1 deletion test/cases/api/aws.s3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function installClient() {

function createReqFile() {
case ${IMAGE_TYPE} in
"$IMAGE_TYPE_EDGE_COMMIT"|"$IMAGE_TYPE_IOT_COMMIT"|"$IMAGE_TYPE_EDGE_CONTAINER"|"$IMAGE_TYPE_EDGE_INSTALLER"|"$IMAGE_TYPE_IMAGE_INSTALLER")
"$IMAGE_TYPE_EDGE_COMMIT"|"$IMAGE_TYPE_IOT_COMMIT"|"$IMAGE_TYPE_EDGE_CONTAINER"|"$IMAGE_TYPE_EDGE_INSTALLER"|"$IMAGE_TYPE_IMAGE_INSTALLER"|"$IMAGE_TYPE_IOT_BOOTABLE_CONTAINER")
createReqFileEdge
;;
"$IMAGE_TYPE_VSPHERE")
Expand Down
Loading
Loading