Skip to content
Open
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
10 changes: 7 additions & 3 deletions artifacts/opensuse/leap/leap.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,19 @@ type leap struct {
var _ api.Artifact = &leap{}

const (
baseURLFmt = "https://download.opensuse.org/distribution/leap/%s/appliances/openSUSE-Leap-%s-Minimal-VM.%s-Cloud.qcow2"
description = `OpenSUSE Leap images for KubeVirt.
leap16BaseURLFmt = "https://download.opensuse.org/distribution/leap/%s/appliances/Leap-%s-Minimal-VM.%s-Cloud.qcow2"
leap15BaseURLFmt = "https://download.opensuse.org/distribution/leap/%s/appliances/openSUSE-Leap-%s-Minimal-VM.%s-Cloud.qcow2"
description = `OpenSUSE Leap images for KubeVirt.
<br />
<br />
Visit [get.opensuse.org/leap/](https://get.opensuse.org/leap/) to learn more about OpenSUSE Leap.`
)

func (l *leap) Inspect() (*api.ArtifactDetails, error) {
baseURL := fmt.Sprintf(baseURLFmt, l.Version, l.Version, l.Arch)
baseURL := fmt.Sprintf(leap16BaseURLFmt, l.Version, l.Version, l.Arch)
if strings.HasPrefix(l.Version, "15") {
baseURL = fmt.Sprintf(leap15BaseURLFmt, l.Version, l.Version, l.Arch)
}
checksumBytes, err := l.getter.GetAll(baseURL + ".sha256")
if err != nil {
return nil, err
Expand Down
41 changes: 41 additions & 0 deletions artifacts/opensuse/leap/leap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,47 @@ var _ = Describe("OpenSUSE Leap", func() {
Expect(c.Metadata()).To(Equal(metadata))
Expect(err).NotTo(HaveOccurred())
},
Entry("leap:16.0 x86_64", "x86_64", "16.0", "testdata/Leap-16.0-Minimal-VM.x86_64-Cloud.qcow2.sha256",
map[string]string{
common.DefaultInstancetypeEnv: "u1.medium",
common.DefaultPreferenceEnv: "opensuse.leap",
Comment on lines +33 to +34
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if these could work on aarch64 too?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The preference set a minimum of 1 cpu and 2GiB. I'm not able to find the minimum requirements for aarch64. @dirkmueller, could you please check if arm version meets this minimum hardware requirements too?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it is officially documented anywhere, but I think that would work. I've started very minimal VMs with that configuration.

},
&api.ArtifactDetails{
Checksum: "8a18cb174d783367e48d34e4e379c5e8f77b0868bcb09350e3627e40090f16fb",
DownloadURL: "https://download.opensuse.org/distribution/leap/16.0/appliances/Leap-16.0-Minimal-VM.x86_64-Cloud.qcow2",
ImageArchitecture: "amd64",
},
&api.Metadata{
Name: "opensuse-leap",
Version: "16.0",
Description: description,
ExampleUserData: docs.UserData{
Username: "opensuse",
},
EnvVariables: map[string]string{
common.DefaultInstancetypeEnv: "u1.medium",
common.DefaultPreferenceEnv: "opensuse.leap",
},
Arch: "x86_64",
},
),
Entry("leap:16.0 aarch64", "aarch64", "16.0", "testdata/Leap-16.0-Minimal-VM.aarch64-Cloud.qcow2.sha256",
nil,
&api.ArtifactDetails{
Checksum: "3fb04efe905b065c25ef1953ce0b53ec680ec661d919c413e2d25986296a0750",
DownloadURL: "https://download.opensuse.org/distribution/leap/16.0/appliances/Leap-16.0-Minimal-VM.aarch64-Cloud.qcow2",
ImageArchitecture: "arm64",
},
&api.Metadata{
Name: "opensuse-leap",
Version: "16.0",
Description: description,
ExampleUserData: docs.UserData{
Username: "opensuse",
},
Arch: "aarch64",
},
),
Entry("leap:15.6 x86_64", "x86_64", "15.6", "testdata/openSUSE-Leap-15.6-Minimal-VM.x86_64-Cloud.qcow2.sha256",
map[string]string{
common.DefaultInstancetypeEnv: "u1.medium",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3fb04efe905b065c25ef1953ce0b53ec680ec661d919c413e2d25986296a0750 Leap-16.0-Minimal-VM.aarch64-Cloud.qcow2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8a18cb174d783367e48d34e4e379c5e8f77b0868bcb09350e3627e40090f16fb Leap-16.0-Minimal-VM.x86_64-Cloud.qcow2
9 changes: 8 additions & 1 deletion cmd/medius/common/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,19 @@ var staticRegistry = []Entry{
},
UseForDocs: true,
},
{
Artifacts: []api.Artifact{
leap.New("x86_64", "16.0", defaultEnvVariables("u1.medium", "opensuse.leap")),
leap.New("aarch64", "16.0", defaultEnvVariables("u1.medium", "opensuse.leap")),
},
UseForDocs: true,
UseForLatest: true,
},
{
Artifacts: []api.Artifact{
leap.New("x86_64", "15.6", defaultEnvVariables("u1.medium", "opensuse.leap")),
leap.New("aarch64", "15.6", defaultEnvVariables("u1.medium", "opensuse.leap")),
},
UseForDocs: true,
},
{
Artifacts: []api.Artifact{
Expand Down