Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enables downloading images from the c-i.u.c/wsl #235

Merged
merged 2 commits into from
Jul 22, 2022

Conversation

CarlosNihelton
Copy link
Collaborator

My Go skills are a bit rusty, so I'd prefer asking review from an expert. 馃槃

Per the CPC team information. Kinetic (22.10) and later versions are to be published to that location (see https://cloud-images.ubuntu.com/wsl/kinetic/ for instance). Previous versions stay in cloud-images.ubuntu.com.

This PR aims to let the build matrix routine to differentiate the base URI from where to download the images.

Only kinetic (22.10) and later are published to that location.
Previous versions stay in cloud-images.ubuntu.com/
@CarlosNihelton CarlosNihelton marked this pull request as ready for review July 21, 2022 15:35
Copy link
Member

@didrocks didrocks left a comment

Choose a reason for hiding this comment

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

No worry! This can be simplified though if I got what you are trying to do. No need to define an anynomous function to execute it right away.

@@ -34,7 +35,14 @@ func buildGHMatrix(csvPath, metaPath string) error {
if i == 0 {
t = ""
}
t += fmt.Sprintf("https://cloud-images.ubuntu.com/%s/current/%s-server-cloudimg-%s-wsl.rootfs.tar.gz::%s", r.CodeName, r.CodeName, arch, arch)
// Currently only Kinetic (22.10) and later are published to "https://cloud-images.ubuntu.com/wsl/"
codeNameSubUri := func() string {
Copy link
Member

Choose a reason for hiding this comment

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

hum, it seems a little bit complicated when you can write it that way:

codeNameSubUri := r.CodeName
if strings.Compare(r.BuildVersion, "2210") >= 0 {
    codeNameSubUri = filepath.Join("wsl", r.CodeName)
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You got it right. Thanks for the suggestion.

Copy link
Member

@didrocks didrocks left a comment

Choose a reason for hiding this comment

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

LGTM! :) Approving

@CarlosNihelton CarlosNihelton merged commit 294c576 into main Jul 22, 2022
@CarlosNihelton CarlosNihelton deleted the new-pipeline-kinetic branch July 22, 2022 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants