This repository has been archived by the owner on Jul 23, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
baremetal: Template RHCOS_IMAGE_URL in startironic.sh
This shouldn't be hard-coded, so instead we replace the URL with the appropriate data from rhcos.json. Related: #37
- Loading branch information
Steven Hardy
committed
Jul 16, 2019
1 parent
25c0a20
commit 8e34abe
Showing
3 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package rhcos | ||
|
||
import ( | ||
"context" | ||
"net/url" | ||
|
||
"github.com/pkg/errors" | ||
) | ||
|
||
// Baremetal fetches the BaseURI where baremetal images can be downloaded from | ||
func Baremetal() (string, error) { | ||
meta, err := fetchRHCOSBuild(context.TODO()) | ||
if err != nil { | ||
return "", errors.Wrap(err, "failed to fetch RHCOS metadata") | ||
} | ||
|
||
base, err := url.Parse(meta.BaseURI) | ||
if err != nil { | ||
return "", err | ||
} | ||
|
||
return base.String(), nil | ||
} |