Skip to content

Commit

Permalink
switch artifacts to map
Browse files Browse the repository at this point in the history
Patch credit - Stephen Lowrie <[email protected]>

Signed-off-by: Sinny Kumari <[email protected]>
  • Loading branch information
sinnykumari committed Jul 10, 2019
1 parent 1da0423 commit 5e56fa0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 24 deletions.
14 changes: 0 additions & 14 deletions common.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,6 @@ type Metadata struct {
LastModified string `json:"last-modified"`
}

// Artifacts contains various artifacts
type Artifacts struct {
Raw *ImageFormat `json:"raw.xz,omitempty"`
Qemu *ImageFormat `json:"qcow.xz,omitempty"`
Ova *ImageFormat `json:"ova,omitempty"`
Tar *ImageFormat `json:"tar.gz,omitempty"`
Vmdk *ImageFormat `json:"vmdk.xz,omitempty"`
Vdi *ImageFormat `json:"vdi.xz,omitempty"`
Iso *ImageFormat `json:"iso,omitempty"`
Pxe *ImageFormat `json:"pxe,omitempty"`
InstIso *ImageFormat `json:"installer.iso,omitempty"`
InstPxe *ImageFormat `json:"installer-pxe,omitempty"`
}

// ImageFormat contains Disk image details
type ImageFormat struct {
Disk *ImageType `json:"disk,omitempty"`
Expand Down
16 changes: 8 additions & 8 deletions release.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ type ReleaseMedia struct {

// ReleaseAws contains AWS image information
type ReleaseAws struct {
Artifacts Artifacts `json:"artifacts"`
Artifacts map[string]*ImageFormat `json:"artifacts"`
Images *map[string]*ReleaseCloudImage `json:"images"`
}

// ReleaseDigitalOcean DigitalOcean image detail
type ReleaseDigitalOcean struct {
Artifacts Artifacts `json:"artifacts"`
Image string `json:"image"`
Artifacts map[string]*ImageFormat `json:"artifacts"`
Image string `json:"image"`
}

// ReleaseAzure Azure image detail
type ReleaseAzure struct {
Artifacts Artifacts `json:"artifacts"`
Images *ReleaseAzureImages `json:"images"`
Artifacts map[string]*ImageFormat `json:"artifacts"`
Images *ReleaseAzureImages `json:"images"`
}

// ReleaseAzureImages Azure image detail
Expand All @@ -52,8 +52,8 @@ type ReleaseAzureImages struct {

// ReleaseGcp GCP image detail
type ReleaseGcp struct {
Artifacts Artifacts `json:"artifacts"`
Image *string `json:"image"`
Artifacts map[string]*ImageFormat `json:"artifacts"`
Image *string `json:"image"`
}

// ReleaseCloudImage cloud image information
Expand All @@ -63,5 +63,5 @@ type ReleaseCloudImage struct {

// ReleaseTargetPlatform target platforms
type ReleaseTargetPlatform struct {
Artifacts Artifacts `json:"artifacts"`
Artifacts map[string]*ImageFormat `json:"artifacts"`
}
4 changes: 2 additions & 2 deletions stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ type StreamArtifacts struct {

// StreamMediaDetails contains image artifact and release detail
type StreamMediaDetails struct {
Release string `json:"release"`
Formats Artifacts `json:"formats"`
Release string `json:"release"`
Formats map[string]*ImageFormat `json:"formats"`
}

// StreamImages contains images available in cloud providers
Expand Down

0 comments on commit 5e56fa0

Please sign in to comment.