Skip to content

Commit

Permalink
baremetal: Always use image cache
Browse files Browse the repository at this point in the history
The metal3-image-cache daemonset is started unconditionally by the
cluster-baremetal-operator, serving on port 6181. However, we were only
pointing at this service in the MachineConfig if the provisioning
network was not present.

Given that the MachineConfig is fixed at install time while the
provisioning network can be added or removed by changing the
Provisioning resource, we should always use the cache.

This also means the cache will get exercised in CI, where previously it
was not.
  • Loading branch information
zaneb committed Jun 16, 2021
1 parent 2a0d2f4 commit fc99be5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pkg/asset/machines/baremetal/machines.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,10 @@ func provider(platform *baremetal.Platform, osImage string, userDataSecret strin
cachedImageFilename := "cached-" + imageFilename

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, cachedImageFilename)
cacheImageURL := fmt.Sprintf("http://%s/images/%s/%s", net.JoinHostPort(cacheImageIP, "6181"), imageFilename, cachedImageFilename)
cacheChecksumURL := fmt.Sprintf("%s.md5sum", cacheImageURL)
config := &baremetalprovider.BareMetalMachineProviderSpec{
TypeMeta: metav1.TypeMeta{
Expand Down

0 comments on commit fc99be5

Please sign in to comment.