mirror of
https://github.com/kubernetes-sigs/external-dns.git
synced 2025-08-06 09:36:58 +02:00
do not attempt UpdateDataLocalizationRegionalHostname() if RegionKey is not set in the plan change; API requires admin role and fails on any change unnecessarily otherwise
This commit is contained in:
parent
39be298595
commit
b282c29ab7
@ -304,7 +304,7 @@ Using the `external-dns.alpha.kubernetes.io/cloudflare-proxied: "true"` annotati
|
||||
|
||||
## Setting cloudflare-region-key to configure regional services
|
||||
|
||||
Using the `external-dns.alpha.kubernetes.io/cloudflare-region-key` annotation on your ingress, you can restrict which data centers can decrypt and serve HTTPS traffic. A list of available options can be seen [here](https://developers.cloudflare.com/data-localization/regional-services/get-started/).
|
||||
Using the `external-dns.alpha.kubernetes.io/cloudflare-region-key` annotation on your ingress, you can restrict which data centers can decrypt and serve HTTPS traffic. A list of available options can be seen [here](https://developers.cloudflare.com/data-localization/regional-services/get-started/). Currently, requires SuperAdmin or Admin role.
|
||||
|
||||
If not set the value will default to `global`.
|
||||
|
||||
|
@ -431,17 +431,18 @@ func (p *CloudFlareProvider) submitChanges(ctx context.Context, changes []*cloud
|
||||
continue
|
||||
}
|
||||
recordParam := updateDNSRecordParam(*change)
|
||||
regionalHostnameParam := updateDataLocalizationRegionalHostnameParams(*change)
|
||||
recordParam.ID = recordID
|
||||
err := p.Client.UpdateDNSRecord(ctx, resourceContainer, recordParam)
|
||||
if err != nil {
|
||||
failedChange = true
|
||||
log.WithFields(logFields).Errorf("failed to update record: %v", err)
|
||||
}
|
||||
regionalHostnameErr := p.Client.UpdateDataLocalizationRegionalHostname(ctx, resourceContainer, regionalHostnameParam)
|
||||
if regionalHostnameErr != nil {
|
||||
failedChange = true
|
||||
log.WithFields(logFields).Errorf("failed to update record when editing region: %v", regionalHostnameErr)
|
||||
if regionalHostnameParam := updateDataLocalizationRegionalHostnameParams(*change); regionalHostnameParam.RegionKey != "" {
|
||||
regionalHostnameErr := p.Client.UpdateDataLocalizationRegionalHostname(ctx, resourceContainer, regionalHostnameParam)
|
||||
if regionalHostnameErr != nil {
|
||||
failedChange = true
|
||||
log.WithFields(logFields).Errorf("failed to update record when editing region: %v", regionalHostnameErr)
|
||||
}
|
||||
}
|
||||
} else if change.Action == cloudFlareDelete {
|
||||
recordID := p.getRecordID(records, change.ResourceRecord)
|
||||
|
Loading…
Reference in New Issue
Block a user