mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-08-14 01:35:34 -04:00
OS images: use "ref", "stream" and "version"
Switch azure default region to west us Update find-image script to work with new API spec Add version for every os image build generate measurements: Use new API paths CLI: config fetch measurements: Use image short versions to fetch measurements CLI: allows shortnames to specify image in config Image build pipeline: Change paths to contain "ref" and "stream"
This commit is contained in:
parent
4795fe9695
commit
4a8ebfd921
28 changed files with 554 additions and 249 deletions
|
@ -36,12 +36,12 @@ func NewDownloader() *Downloader {
|
|||
}
|
||||
|
||||
// Download downloads the raw image from source.
|
||||
func (d *Downloader) Download(ctx context.Context, errWriter io.Writer, showBar bool, source, version string) (string, error) {
|
||||
func (d *Downloader) Download(ctx context.Context, errWriter io.Writer, showBar bool, source, imageName string) (string, error) {
|
||||
url, err := url.Parse(source)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("parsing image source URL: %w", err)
|
||||
}
|
||||
version = filepath.Base(version)
|
||||
imageName = filepath.Base(imageName)
|
||||
var partfile, destination string
|
||||
switch url.Scheme {
|
||||
case "http", "https":
|
||||
|
@ -49,8 +49,8 @@ func (d *Downloader) Download(ctx context.Context, errWriter io.Writer, showBar
|
|||
if err != nil {
|
||||
return "", fmt.Errorf("getting current working directory: %w", err)
|
||||
}
|
||||
partfile = filepath.Join(cwd, version+".raw.part")
|
||||
destination = filepath.Join(cwd, version+".raw")
|
||||
partfile = filepath.Join(cwd, imageName+".raw.part")
|
||||
destination = filepath.Join(cwd, imageName+".raw")
|
||||
case "file":
|
||||
return url.Path, nil
|
||||
default:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue