Skip to content

Commit

Permalink
Add an Azure entry
Browse files Browse the repository at this point in the history
This contains just a URL for now. It's what RHCOS does
today and will likely be doing so for the near future.
For FCOS we may end up doing something similar too.

Closes: coreos#13
  • Loading branch information
cgwalters committed Jan 25, 2021
1 parent 2fbf874 commit 364f7aa
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
13 changes: 12 additions & 1 deletion release/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type Arch struct {
type Media struct {
Aliyun *PlatformBase `json:"aliyun"`
Aws *PlatformAws `json:"aws"`
Azure *PlatformBase `json:"azure"`
Azure *PlatformAzure `json:"azure"`
Digitalocean *PlatformBase `json:"digitalocean"`
Exoscale *PlatformBase `json:"exoscale"`
Gcp *PlatformGcp `json:"gcp"`
Expand Down Expand Up @@ -105,3 +105,14 @@ type GcpImage struct {
Family string `json:"family,omitempty"`
Name string `json:"name,omitempty"`
}

// PlatformAzure represents an Azure cloud image
type PlatformAzure struct {
PlatformBase
Image *AzureImage `json:"image"`
}

// AzureImage represents an Azure cloud image
type AzureImage struct {
URL string `json:"url,omitempty"`
}
12 changes: 6 additions & 6 deletions release/translate.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ func (releaseArch *Arch) toStreamArch(rel *Release) stream.Arch {
Formats: mapFormats(releaseArch.Media.Azure.Artifacts),
}

// Not enabled right now
// if az := releaseArch.Media.Azure.Images; az != nil && az.Global != nil && az.Global.Image != nil {
// azureImage := StreamCloudImage{}
// azureImage.Image = fmt.Sprintf("Fedora:CoreOS:%s:latest", rel.Stream)
// cloudImages.Azure = &azureImage
// }
azi := releaseArch.Media.Azure.Image
if azi != nil {
cloudImages.Azure = &stream.AzureImage{
URL: azi.URL,
}
}
}

if releaseArch.Media.Aliyun != nil {
Expand Down
6 changes: 6 additions & 0 deletions stream/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ type Artifact struct {
type Images struct {
Aws *AwsImage `json:"aws,omitempty"`
Gcp *GcpImage `json:"gcp,omitempty"`
Azure *AzureImage `json:"azure,omitempty"`
}

// AwsImage represents an image across all AWS regions
Expand All @@ -66,3 +67,8 @@ type GcpImage struct {
Family string `json:"family,omitempty"`
Name string `json:"name,omitempty"`
}

// AzureImage represents an Azure cloud image
type AzureImage struct {
URL string `json:"url,omitempty"`
}

0 comments on commit 364f7aa

Please sign in to comment.