2022-09-05 03:06:08 -04:00
|
|
|
/*
|
|
|
|
Copyright (c) Edgeless Systems GmbH
|
|
|
|
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2022-08-23 07:19:37 -04:00
|
|
|
package main
|
|
|
|
|
|
|
|
import "encoding/json"
|
|
|
|
|
|
|
|
type Manifest struct {
|
|
|
|
releases map[string]Images
|
|
|
|
}
|
|
|
|
|
|
|
|
type Images struct {
|
2022-10-21 04:16:44 -04:00
|
|
|
AzureOSImage string `json:"AzureOSImage"`
|
|
|
|
GCPOSImage string `json:"GCPOSImage"`
|
2022-08-23 07:19:37 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// OldManifests provides Constellation releases to image mapping. These are the
|
|
|
|
// default images configured for each release.
|
|
|
|
func OldManifests() Manifest {
|
|
|
|
return Manifest{
|
|
|
|
releases: map[string]Images{
|
|
|
|
"v1.0.0": {
|
2022-10-21 04:16:44 -04:00
|
|
|
AzureOSImage: "/subscriptions/0d202bbb-4fa7-4af8-8125-58c269a05435/resourceGroups/CONSTELLATION-IMAGES/providers/Microsoft.Compute/galleries/Constellation/images/constellation-coreos/versions/0.0.1651150807",
|
|
|
|
GCPOSImage: "constellation-coreos-1651150807",
|
2022-08-23 07:19:37 -04:00
|
|
|
},
|
|
|
|
"v1.1.0": {
|
2022-10-21 04:16:44 -04:00
|
|
|
AzureOSImage: "/subscriptions/0d202bbb-4fa7-4af8-8125-58c269a05435/resourceGroups/CONSTELLATION-IMAGES/providers/Microsoft.Compute/galleries/Constellation/images/constellation-coreos/versions/0.0.1654096948",
|
|
|
|
GCPOSImage: "projects/constellation-images/global/images/constellation-coreos-1654096948",
|
2022-08-23 07:19:37 -04:00
|
|
|
},
|
|
|
|
"v1.2.0": {
|
2022-10-21 04:16:44 -04:00
|
|
|
AzureOSImage: "/subscriptions/0d202bbb-4fa7-4af8-8125-58c269a05435/resourceGroups/CONSTELLATION-IMAGES/providers/Microsoft.Compute/galleries/Constellation/images/constellation-coreos/versions/0.0.1654162332",
|
|
|
|
GCPOSImage: "projects/constellation-images/global/images/constellation-coreos-1654162332",
|
2022-08-23 07:19:37 -04:00
|
|
|
},
|
|
|
|
"v1.3.0": {
|
2022-10-21 04:16:44 -04:00
|
|
|
AzureOSImage: "/subscriptions/0d202bbb-4fa7-4af8-8125-58c269a05435/resourceGroups/CONSTELLATION-IMAGES/providers/Microsoft.Compute/galleries/Constellation/images/constellation-coreos/versions/0.0.1654162332",
|
|
|
|
GCPOSImage: "projects/constellation-images/global/images/constellation-coreos-1654162332",
|
2022-08-23 07:19:37 -04:00
|
|
|
},
|
|
|
|
"v1.3.1": {
|
2022-10-21 04:16:44 -04:00
|
|
|
AzureOSImage: "/subscriptions/0d202bbb-4fa7-4af8-8125-58c269a05435/resourceGroups/CONSTELLATION-IMAGES/providers/Microsoft.Compute/galleries/Constellation/images/constellation-coreos/versions/0.0.1657199013",
|
|
|
|
GCPOSImage: "projects/constellation-images/global/images/constellation-coreos-1657199013",
|
2022-08-23 07:19:37 -04:00
|
|
|
},
|
|
|
|
"v1.4.0": {
|
2022-10-21 04:16:44 -04:00
|
|
|
AzureOSImage: "/subscriptions/0d202bbb-4fa7-4af8-8125-58c269a05435/resourceGroups/CONSTELLATION-IMAGES/providers/Microsoft.Compute/galleries/Constellation/images/constellation-coreos/versions/0.0.1659453699",
|
|
|
|
GCPOSImage: "projects/constellation-images/global/images/constellation-coreos-1659453699",
|
2022-08-23 07:19:37 -04:00
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Manifest) MarshalJSON() ([]byte, error) {
|
|
|
|
return json.Marshal(m.releases)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Manifest) SetAzureImage(version string, image string) {
|
|
|
|
if release, ok := m.releases[version]; !ok {
|
2022-10-21 04:16:44 -04:00
|
|
|
images := Images{AzureOSImage: image}
|
2022-08-23 07:19:37 -04:00
|
|
|
m.releases[version] = images
|
|
|
|
} else {
|
2022-10-21 04:16:44 -04:00
|
|
|
release.AzureOSImage = image
|
2022-08-23 07:19:37 -04:00
|
|
|
m.releases[version] = release
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Manifest) SetGCPImage(version string, image string) {
|
|
|
|
if release, ok := m.releases[version]; !ok {
|
2022-10-21 04:16:44 -04:00
|
|
|
images := Images{GCPOSImage: image}
|
2022-08-23 07:19:37 -04:00
|
|
|
m.releases[version] = images
|
|
|
|
} else {
|
2022-10-21 04:16:44 -04:00
|
|
|
release.GCPOSImage = image
|
2022-08-23 07:19:37 -04:00
|
|
|
m.releases[version] = release
|
|
|
|
}
|
|
|
|
}
|