Skip to content

Commit

Permalink
baremetal: correct the cacheImageURL when we don't have a provisioningIP
Browse files Browse the repository at this point in the history
  • Loading branch information
asalkeld committed Nov 24, 2020
1 parent 68282c1 commit be5aa7c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/asset/machines/baremetal/machines.go
Expand Up @@ -86,7 +86,14 @@ func provider(platform *baremetal.Platform, osImage string, userDataSecret strin
// ref https://github.com/openshift/ironic-rhcos-downloader/pull/12
imageFilename := path.Base(strings.TrimSuffix(imageURL.String(), ".gz"))
compressedImageFilename := strings.Replace(imageFilename, "openstack", "compressed", 1)
cacheImageURL := fmt.Sprintf("http://%s/images/%s/%s", net.JoinHostPort(platform.ClusterProvisioningIP, "6180"), imageFilename, compressedImageFilename)

cacheImageIP := platform.ClusterProvisioningIP
cacheImagePort := "6180"
if platform.ProvisioningNetwork == baremetal.DisabledProvisioningNetwork && platform.ClusterProvisioningIP == "" {
cacheImageIP = platform.APIVIP
cacheImagePort = "6181"
}
cacheImageURL := fmt.Sprintf("http://%s/images/%s/%s", net.JoinHostPort(cacheImageIP, cacheImagePort), imageFilename, compressedImageFilename)
cacheChecksumURL := fmt.Sprintf("%s.md5sum", cacheImageURL)
config := &baremetalprovider.BareMetalMachineProviderSpec{
TypeMeta: metav1.TypeMeta{
Expand Down

0 comments on commit be5aa7c

Please sign in to comment.