mirror of
https://github.com/kubernetes-sigs/external-dns.git
synced 2025-08-07 01:56:57 +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
|
## 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`.
|
If not set the value will default to `global`.
|
||||||
|
|
||||||
|
@ -431,17 +431,18 @@ func (p *CloudFlareProvider) submitChanges(ctx context.Context, changes []*cloud
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
recordParam := updateDNSRecordParam(*change)
|
recordParam := updateDNSRecordParam(*change)
|
||||||
regionalHostnameParam := updateDataLocalizationRegionalHostnameParams(*change)
|
|
||||||
recordParam.ID = recordID
|
recordParam.ID = recordID
|
||||||
err := p.Client.UpdateDNSRecord(ctx, resourceContainer, recordParam)
|
err := p.Client.UpdateDNSRecord(ctx, resourceContainer, recordParam)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
failedChange = true
|
failedChange = true
|
||||||
log.WithFields(logFields).Errorf("failed to update record: %v", err)
|
log.WithFields(logFields).Errorf("failed to update record: %v", err)
|
||||||
}
|
}
|
||||||
regionalHostnameErr := p.Client.UpdateDataLocalizationRegionalHostname(ctx, resourceContainer, regionalHostnameParam)
|
if regionalHostnameParam := updateDataLocalizationRegionalHostnameParams(*change); regionalHostnameParam.RegionKey != "" {
|
||||||
if regionalHostnameErr != nil {
|
regionalHostnameErr := p.Client.UpdateDataLocalizationRegionalHostname(ctx, resourceContainer, regionalHostnameParam)
|
||||||
failedChange = true
|
if regionalHostnameErr != nil {
|
||||||
log.WithFields(logFields).Errorf("failed to update record when editing region: %v", regionalHostnameErr)
|
failedChange = true
|
||||||
|
log.WithFields(logFields).Errorf("failed to update record when editing region: %v", regionalHostnameErr)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if change.Action == cloudFlareDelete {
|
} else if change.Action == cloudFlareDelete {
|
||||||
recordID := p.getRecordID(records, change.ResourceRecord)
|
recordID := p.getRecordID(records, change.ResourceRecord)
|
||||||
|
Loading…
Reference in New Issue
Block a user