Skip to content

Commit

Permalink
Add support for IBMCloud/PowerVS images
Browse files Browse the repository at this point in the history
Adding support for IBMCloud/PowerVS objects to be added to the stream.

similar to coreos/stream-metadata-go#35
  • Loading branch information
Prashanth684 committed Nov 2, 2021
1 parent 13f40d8 commit dd48b38
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ pub struct AwsRegionImage {
#[derive(Debug, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub struct GcpImage {
/// The release version of FCOS.
pub release: String,
/// The project ID.
pub project: String,
/// The image family.
Expand All @@ -99,6 +101,28 @@ pub struct GcpImage {
pub name: String,
}

/// ReplicatedObject storage images for clouds like IBMCloud/PowerVS
#[derive(Debug, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub struct ReplicatedObject {
/// Mapping from region name to the object.
pub regions: HashMap<String, RegionObject>,
}

/// RegionObject like the ones used for IBMCloud/PowerVS platform containing release, object, bucket and url .
#[derive(Debug, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "kebab-case")]
pub struct RegionObject {
/// The release version of FCOS.
pub release: String,
/// The actual object in the cloud object storage (.ova.gz for PowerVS, .qcow2 for IBMCloud)
pub object: String,
/// The bucket where the object resides.
pub bucket: String,
/// The url of the object.
pub url: String,
}

/// Public cloud images.
#[derive(Debug, Deserialize)]
#[serde(rename_all = "kebab-case")]
Expand All @@ -107,6 +131,10 @@ pub struct Images {
pub aws: Option<AwsImages>,
/// Images for GCP.
pub gcp: Option<GcpImage>,
/// Objects for IBMCloud
pub ibmcloud: Option<ReplicatedObject>,
/// Objects for PowerVS
pub powervs: Option<ReplicatedObject>,
}

impl Stream {
Expand Down

0 comments on commit dd48b38

Please sign in to comment.