forked from openshift-metal3/kni-installer
-
Notifications
You must be signed in to change notification settings - Fork 0
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: openshift-metal3#37
- Loading branch information
Steven Hardy
committed
Jul 16, 2019
1 parent
41b6b8a
commit e019bc1
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 | ||
} |