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,