Skip to content

fix(accessapplication): adopt existing apps by domain instead of name#44

Open
mxhob1 wants to merge 1 commit into
StringKe:mainfrom
mxhob1:fix/rekey-adoption-on-domain
Open

fix(accessapplication): adopt existing apps by domain instead of name#44
mxhob1 wants to merge 1 commit into
StringKe:mainfrom
mxhob1:fix/rekey-adoption-on-domain

Conversation

@mxhob1

@mxhob1 mxhob1 commented Jun 3, 2026

Copy link
Copy Markdown

Description

Adoption — the path taken when Status.ApplicationID is empty — matched existing
Cloudflare apps by display name. Display names aren't unique, so two CRs sharing a
name adopt the same app and overwrite each other's domain and policies. Match on the
primary domain instead (unique per account), and create when there's no match.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Related Issues

Checklist

  • My code follows the project's coding standards
  • I have added/updated tests for my changes
  • All new and existing tests pass (make test)
  • Linting passes (make lint)
  • CRD manifests are up-to-date (make manifests generate)

Testing

make test and make lint pass; make manifests generate is a no-op.
ListAccessApplicationsByDomain mirrors the existing ListAccessApplicationsByName,
which has no unit test in this package.

Additional Notes

Matches the primary domain only, not SelfHostedDomains.

When Status.ApplicationID is empty the reconciler adopts an existing
Cloudflare app rather than creating one; it matched on the display name,
which is not unique, so two AccessApplications sharing a name adopt the
same app and overwrite each other's domain and policies. Match on the
primary domain instead, which Cloudflare enforces as unique per account,
and create a new app when nothing matches.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant