-
Notifications
You must be signed in to change notification settings - Fork 2.8k
chore(cloudflare): use lib v4 for regional services #5609
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(cloudflare): use lib v4 for regional services #5609
Conversation
Hi @vflaux. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/ok-to-test |
5cfc160
to
00b2c47
Compare
00b2c47
to
c403285
Compare
c403285
to
72dc47b
Compare
72dc47b
to
e247152
Compare
smoke tests:external-dns args
validationGET on https://api.cloudflare.com/client/v4/zones/:zone_id/addressing/regional_hostnames CasesCreateCreate new ingress with regional key to "eu". Ingress: apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: test
namespace: default
annotations:
external-dns.alpha.kubernetes.io/cloudflare-region-key: "eu"
spec:
ingressClassName: cloudflare
rules:
- host: external-dns-test.xxx.xx
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: test
port:
name: http Log: {"action":"CREATE","hostname":"external-dns-test.xxx.xx","level":"debug","msg":"Creating regional hostname","region_key":"eu","time":"xxx","zone":"xxx"} Cloudflare: {
"success": true,
"errors": [],
"result": [
{
"hostname": "external-dns-test.xxx.xx",
"region_key": "eu",
"created_on": "xxx"
}
],
"messages": []
} UpdateUpdate ingress with regional key "us". Ingress: apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: test
namespace: default
annotations:
external-dns.alpha.kubernetes.io/cloudflare-region-key: "us" Log: {"action":"UPDATE","hostname":"external-dns-test.xxx.xx","level":"debug","msg":"Updating regional hostname","region_key":"us","time":"xxx","zone":"xxx"} Cloudflare: {
"success": true,
"errors": [],
"result": [
{
"hostname": "external-dns-test.xxx.xx",
"region_key": "us",
"created_on": "xxx"
}
],
"messages": []
} UpdateDelete ingress. Log: {"action":"DELETE","hostname":"external-dns-test.xxx.xx","level":"debug","msg":"Deleting regional hostname","region_key":"","time":"xxx","zone":"xxx"} Cloudflare: {
"success": true,
"errors": [],
"result": [],
"messages": []
} |
e247152
to
7304ba0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closes #5540
/lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
There's still a long way to migrate other parts !
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mloiseleur The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
…5609) * chore(cloudflare): add cloudflare v4 client * chrome(cloudflare): cli v4 for regional hostanmes
What does it do ?
Migrate the regional services logic to the cloudflare lib v4.
We keep the old version for other parts (zone, custom hostnames, dns).
The v4 lib do not have the(done in #5615).RegionalHostname
struct so I redefined itI also introduce a function
autoPagerIterator()
to convert the v4 lib "AutoPager" to a go iterator.This is used only once for now but it is intended to be used in other list calls.
There is no changes in the logic, simply a different api / structs.
Motivation
The current client is not supported anymore.
See #5540.
More