Skip to content
Snippets Groups Projects
Commit 35cb909a authored by Niels Möller's avatar Niels Möller
Browse files

Allow relative OS package URL in CreateOSPackage

parent 286cb01d
Branches
Tags v0.4.0
No related merge requests found
......@@ -76,10 +76,10 @@ func CreateOSPackageCtx(ctx context.Context, label, pkgURL, kernel, initramfs, c
return nil, fmt.Errorf("invalid package URL %q, %w", pkgURL, err)
}
if uri.Scheme == "" || uri.Scheme != "http" && uri.Scheme != "https" {
stlog.Debug("os package: OS package URL: missing or unsupported scheme in %s", uri.String())
if uri.IsAbs() && (uri.Scheme != "http" && uri.Scheme != "https") {
stlog.Debug("os package: OS package URL: unsupported scheme in %s", pkgURL)
return nil, fmt.Errorf("invalid package URL %q, missing or unsupported scheme", pkgURL)
return nil, fmt.Errorf("invalid package URL %q, unsupported scheme", pkgURL)
}
osp.descriptor.PkgURL = pkgURL
......@@ -104,7 +104,7 @@ func CreateOSPackageCtx(ctx context.Context, label, pkgURL, kernel, initramfs, c
}
if err := osp.validate(); err != nil {
return nil, fmt.Errorf("OS package faield to validate: %w", err)
return nil, fmt.Errorf("OS package failed to validate: %w", err)
}
return osp, nil
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment