-
Notifications
You must be signed in to change notification settings - Fork 2.8k
chore(cloudflare): migrate customhostname to v5 #5891
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
base: master
Are you sure you want to change the base?
chore(cloudflare): migrate customhostname to v5 #5891
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Pull Request Test Coverage Report for Build 19845553576Details
💛 - Coveralls |
|
@vflaux @mrozentsvayg Any comment on this PR ? Do you think you can review it ? |
provider/cloudflare/cloudflare.go
Outdated
| if strings.Contains(errStr, "exceeded available rate limit retries") || | ||
| strings.Contains(errStr, "rate limit") || | ||
| strings.Contains(errStr, "429") { |
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.
I think we should handle this according to the doc here: https://github.com/cloudflare/cloudflare-go?tab=readme-ov-file#errors
var apierr *cloudflare.Error
if errors.As(err, &apierr) {
if apierr.StatusCode == http.StatusTooManyRequests {
}
}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.
This was implemented
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.
so why do we have this code here?
- Rate limit errors are not returned as ErrorTypeRateLimit cloudflare/cloudflare-go#4155 talks about the v0 version of the library which we don't use after merging your PR.
- the first string.Contains is not needed if you have the second one.
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.
Sorry forgot to commit it. It's gone now
|
@vflaux: changing LGTM is restricted to collaborators In response to this: 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. |
|
How did broken tests get merged in? |
This should be fixed, see #5896. |
|
/retest |
|
@vflaux everything look good now? |
vflaux
left a comment
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.
I've not review all the new tests yet.
Looks like IA generated, some clearly improve test coverage, others seems less relevant. 😄
|
The tests just fail because of rate limits to coveralls |
|
Did you @AndrewCharlesHay address comments by @vflaux ? Cleaning up things that are not useful is always great for maintaining the software. |
|
@szuecs yep all updated |
|
@AndrewCharlesHay Would you please rebase ? |
e0eb277 to
bcad628
Compare
mloiseleur
left a comment
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.
@vflaux Anything left on your side ?
|
Was this code tested against cloudflare? Change does look riskie without testing. |
provider/cloudflare/cloudflare.go
Outdated
| return z.serviceV0.CreateCustomHostname(ctx, zoneID, ch) | ||
| func (z zoneService) CreateCustomHostname(ctx context.Context, zoneID string, ch CustomHostname) error { | ||
| params := buildCustomHostnameNewParams(zoneID, ch) | ||
| _, err := z.service.CustomHostnames.New(ctx, params) |
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.
this creates a custom hostname with empty origin server, and then breaks infinitely attempting and failing to recreate the duplicate;
api v5 makes setting the custom origin server so much less obvious for the reason I don't understand;
but this works as expected in my testing:
- _, err := z.service.CustomHostnames.New(ctx, params)
+ _, err := z.service.CustomHostnames.New(ctx, params,
+ option.WithJSONSet("custom_origin_server", ch.CustomOriginServer))
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.
@mrozentsvayg Thank you for the suggestion! I’ve updated the implementation to explicitly set custom_origin_server using option.WithJSONSet as you recommended. This resolves the issue with empty origin servers and infinite retries. The change is now pushed, and all tests pass.
|
@mrozentsvayg: changing LGTM is restricted to collaborators In response to this: 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. |
|
PR needs rebase. 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. |
* build: tool remove vacuum in order to get rid of BUSL-1.1 license of a dependency in go.mod/go.tool.mod Signed-off-by: Sandor Szuecs <[email protected]> * rm vacuum Signed-off-by: Sandor Szuecs <[email protected]> * remove also from CI Signed-off-by: Sandor Szuecs <[email protected]> --------- Signed-off-by: Sandor Szuecs <[email protected]>
…s#5958) Signed-off-by: Michel Loiseleur <[email protected]>
Bumps the dev-dependencies group with 1 update: [github.com/digitalocean/godo](https://github.com/digitalocean/godo). Updates `github.com/digitalocean/godo` from 1.168.0 to 1.169.0 - [Release notes](https://github.com/digitalocean/godo/releases) - [Changelog](https://github.com/digitalocean/godo/blob/main/CHANGELOG.md) - [Commits](digitalocean/godo@v1.168.0...v1.169.0) --- updated-dependencies: - dependency-name: github.com/digitalocean/godo dependency-version: 1.169.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the dev-dependencies group with 1 update: [renovatebot/github-action](https://github.com/renovatebot/github-action). Updates `renovatebot/github-action` from 44.0.1 to 44.0.2 - [Release notes](https://github.com/renovatebot/github-action/releases) - [Changelog](https://github.com/renovatebot/github-action/blob/main/CHANGELOG.md) - [Commits](renovatebot/github-action@v44.0.1...v44.0.2) --- updated-dependencies: - dependency-name: renovatebot/github-action dependency-version: 44.0.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* end to end testing with local provider implementation Signed-off-by: Raffaele Di Fazio <[email protected]> * Update .github/workflows/end-to-end-tests.yml Co-authored-by: Michel Loiseleur <[email protected]> * Update e2e/deployment.yaml Co-authored-by: Michel Loiseleur <[email protected]> * move e2e to coredns Signed-off-by: Raffaele Di Fazio <[email protected]> * newlines Signed-off-by: Raffaele Di Fazio <[email protected]> * Update scripts/e2e-test.sh Co-authored-by: Michel Loiseleur <[email protected]> * drop all comments Signed-off-by: Raffaele Di Fazio <[email protected]> * Update .github/workflows/end-to-end-tests.yml Co-authored-by: Michel Loiseleur <[email protected]> --------- Signed-off-by: Raffaele Di Fazio <[email protected]> Co-authored-by: Michel Loiseleur <[email protected]>
…10 updates (kubernetes-sigs#5970) Bumps the dev-dependencies group with 7 updates in the / directory: | Package | From | To | | --- | --- | --- | | [github.com/aws/aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2) | `1.39.6` | `1.40.0` | | [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) | `1.31.20` | `1.32.0` | | [github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue](https://github.com/aws/aws-sdk-go-v2) | `1.20.23` | `1.20.25` | | [github.com/aws/aws-sdk-go-v2/service/route53](https://github.com/aws/aws-sdk-go-v2) | `1.59.5` | `1.60.1` | | [github.com/aws/aws-sdk-go-v2/service/servicediscovery](https://github.com/aws/aws-sdk-go-v2) | `1.39.16` | `1.39.17` | | [github.com/oracle/oci-go-sdk/v65](https://github.com/oracle/oci-go-sdk) | `65.104.1` | `65.105.0` | | [github.com/prometheus/common](https://github.com/prometheus/common) | `0.67.2` | `0.67.3` | Updates `github.com/aws/aws-sdk-go-v2` from 1.39.6 to 1.40.0 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json) - [Commits](aws/aws-sdk-go-v2@v1.39.6...v1.40.0) Updates `github.com/aws/aws-sdk-go-v2/config` from 1.31.20 to 1.32.0 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json) - [Commits](aws/aws-sdk-go-v2@config/v1.31.20...v1.32.0) Updates `github.com/aws/aws-sdk-go-v2/credentials` from 1.18.24 to 1.19.0 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/v1.19.0/CHANGELOG.md) - [Commits](aws/aws-sdk-go-v2@config/v1.18.24...v1.19.0) Updates `github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue` from 1.20.23 to 1.20.25 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json) - [Commits](aws/aws-sdk-go-v2@feature/dynamodb/attributevalue/v1.20.23...feature/dynamodb/attributevalue/v1.20.25) Updates `github.com/aws/aws-sdk-go-v2/service/dynamodb` from 1.52.6 to 1.53.1 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json) - [Commits](aws/aws-sdk-go-v2@service/ssm/v1.52.6...service/s3/v1.53.1) Updates `github.com/aws/aws-sdk-go-v2/service/route53` from 1.59.5 to 1.60.1 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json) - [Commits](aws/aws-sdk-go-v2@service/iot/v1.59.5...service/s3/v1.60.1) Updates `github.com/aws/aws-sdk-go-v2/service/servicediscovery` from 1.39.16 to 1.39.17 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json) - [Commits](aws/aws-sdk-go-v2@service/personalize/v1.39.16...service/servicediscovery/v1.39.17) Updates `github.com/aws/aws-sdk-go-v2/service/sts` from 1.40.2 to 1.41.1 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json) - [Commits](aws/aws-sdk-go-v2@service/s3/v1.40.2...service/kms/v1.41.1) Updates `github.com/oracle/oci-go-sdk/v65` from 65.104.1 to 65.105.0 - [Release notes](https://github.com/oracle/oci-go-sdk/releases) - [Changelog](https://github.com/oracle/oci-go-sdk/blob/master/CHANGELOG.md) - [Commits](oracle/oci-go-sdk@v65.104.1...v65.105.0) Updates `github.com/prometheus/common` from 0.67.2 to 0.67.3 - [Release notes](https://github.com/prometheus/common/releases) - [Changelog](https://github.com/prometheus/common/blob/main/CHANGELOG.md) - [Commits](prometheus/common@v0.67.2...v0.67.3) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2 dependency-version: 1.40.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/config dependency-version: 1.32.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/credentials dependency-version: 1.19.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue dependency-version: 1.20.25 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/service/dynamodb dependency-version: 1.53.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/service/route53 dependency-version: 1.60.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/service/servicediscovery dependency-version: 1.39.17 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/service/sts dependency-version: 1.41.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: github.com/oracle/oci-go-sdk/v65 dependency-version: 65.105.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: github.com/prometheus/common dependency-version: 0.67.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…es-sigs#5969) Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.44.0 to 0.45.0. - [Commits](golang/crypto@v0.44.0...v0.45.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-version: 0.45.0 dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ubernetes-sigs#5534) According to RFC2782 [1], SRV records are to be fully-qualified, ending with a final dot. Most providers are liberal, but e.g. OpenStack Designate expects targets to end with a dot ([2]) [1] https://datatracker.ietf.org/doc/html/rfc2782 [2] https://github.com/openstack/designate/blob/a891d81974a4c3aa56a143252b26df9dcbd5fba5/designate/objects/fields.py#L235-L236 Signed-off-by: Christian Rohmann <[email protected]>
Add alternative UniFi webhook provider implementation. Signed-off-by: Aleksei Sviridkin <[email protected]> Co-authored-by: Claude <[email protected]>
…9 updates (kubernetes-sigs#5976) Bumps the dev-dependencies group with 6 updates in the / directory: | Package | From | To | | --- | --- | --- | | [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) | `1.32.0` | `1.32.2` | | [github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue](https://github.com/aws/aws-sdk-go-v2) | `1.20.25` | `1.20.26` | | [github.com/aws/aws-sdk-go-v2/service/route53](https://github.com/aws/aws-sdk-go-v2) | `1.60.1` | `1.61.0` | | [github.com/aws/aws-sdk-go-v2/service/servicediscovery](https://github.com/aws/aws-sdk-go-v2) | `1.39.17` | `1.39.18` | | [github.com/prometheus/common](https://github.com/prometheus/common) | `0.67.3` | `0.67.4` | | gopkg.in/ns1/ns1-go.v2 | `2.15.1` | `2.15.2` | Updates `github.com/aws/aws-sdk-go-v2/config` from 1.32.0 to 1.32.2 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json) - [Commits](aws/aws-sdk-go-v2@v1.32.0...v1.32.2) Updates `github.com/aws/aws-sdk-go-v2/credentials` from 1.19.0 to 1.19.2 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json) - [Commits](aws/aws-sdk-go-v2@v1.19.0...service/m2/v1.19.2) Updates `github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue` from 1.20.25 to 1.20.26 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json) - [Commits](aws/aws-sdk-go-v2@feature/dynamodb/attributevalue/v1.20.25...feature/dynamodb/attributevalue/v1.20.26) Updates `github.com/aws/aws-sdk-go-v2/service/dynamodb` from 1.53.1 to 1.53.2 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json) - [Commits](aws/aws-sdk-go-v2@service/s3/v1.53.1...service/s3/v1.53.2) Updates `github.com/aws/aws-sdk-go-v2/service/route53` from 1.60.1 to 1.61.0 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json) - [Commits](aws/aws-sdk-go-v2@service/s3/v1.60.1...service/s3/v1.61.0) Updates `github.com/aws/aws-sdk-go-v2/service/servicediscovery` from 1.39.17 to 1.39.18 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json) - [Commits](aws/aws-sdk-go-v2@service/servicediscovery/v1.39.17...service/servicediscovery/v1.39.18) Updates `github.com/aws/aws-sdk-go-v2/service/sts` from 1.41.1 to 1.41.2 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json) - [Commits](aws/aws-sdk-go-v2@service/kms/v1.41.1...service/ivs/v1.41.2) Updates `github.com/prometheus/common` from 0.67.3 to 0.67.4 - [Release notes](https://github.com/prometheus/common/releases) - [Changelog](https://github.com/prometheus/common/blob/main/CHANGELOG.md) - [Commits](prometheus/common@v0.67.3...v0.67.4) Updates `gopkg.in/ns1/ns1-go.v2` from 2.15.1 to 2.15.2 --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/config dependency-version: 1.32.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/credentials dependency-version: 1.19.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue dependency-version: 1.20.26 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/service/dynamodb dependency-version: 1.53.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/service/route53 dependency-version: 1.61.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/service/servicediscovery dependency-version: 1.39.18 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/service/sts dependency-version: 1.41.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/prometheus/common dependency-version: 0.67.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: gopkg.in/ns1/ns1-go.v2 dependency-version: 2.15.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…oup (kubernetes-sigs#5985) Bumps the dev-dependencies group with 1 update: [github.com/goccy/go-yaml](https://github.com/goccy/go-yaml). Updates `github.com/goccy/go-yaml` from 1.18.0 to 1.19.0 - [Release notes](https://github.com/goccy/go-yaml/releases) - [Changelog](https://github.com/goccy/go-yaml/blob/master/CHANGELOG.md) - [Commits](goccy/go-yaml@v1.18.0...v1.19.0) --- updated-dependencies: - dependency-name: github.com/goccy/go-yaml dependency-version: 1.19.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
… comments - Add comprehensive test coverage for buildCustomHostnameNewParams function - Improve comment explaining why string-based rate limit detection is needed with v5 SDK (SDK's retry logic can wrap errors hiding structured types) - Addresses reviewer feedback about test coverage and error handling rationale
cfefead to
803de1a
Compare
|
Keywords which can automatically close issues and at(@) or hashtag(#) mentions are not allowed in commit messages. The list of commits with invalid commit messages:
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. I understand the commands that are listed here. |
|
@AndrewCharlesHay: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. I understand the commands that are listed here. |
What does it do ?
Migrate customhostname to v5
Motivation
Closes #5540
More