From af008bdb71008976f73d16146b52bfd037f4d166 Mon Sep 17 00:00:00 2001 From: Mike Turek Date: Fri, 12 Jul 2024 16:26:07 -0400 Subject: [PATCH] Use the COS endpoint override when generating bootstrap ignition (#1860) When overridding the COS endpoint in the disconnected use case, we'll need to also grab ignition from the same endpoint. --- cloud/scope/powervs_machine.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cloud/scope/powervs_machine.go b/cloud/scope/powervs_machine.go index 6f70a950f..16509cbc7 100644 --- a/cloud/scope/powervs_machine.go +++ b/cloud/scope/powervs_machine.go @@ -422,6 +422,12 @@ func (m *PowerVSMachineScope) createIgnitionData(data []byte) (string, error) { } objHost := fmt.Sprintf("%s.s3.%s.%s", bucket, region, cosURLDomain) + + cosServiceEndpoint := endpoints.FetchEndpoints(string(endpoints.COS), m.ServiceEndpoint) + if cosServiceEndpoint != "" { + m.Logger.V(3).Info("Overriding the default COS endpoint in ignition URL", "cosEndpoint", cosServiceEndpoint) + objHost = fmt.Sprintf("%s.%s", bucket, cosServiceEndpoint) + } objectURL := &url.URL{ Scheme: "https", Host: objHost,