feat(access): add AccessTag CRD to manage Zero Trust Access tags#45
Open
mxhob1 wants to merge 5 commits into
Open
feat(access): add AccessTag CRD to manage Zero Trust Access tags#45mxhob1 wants to merge 5 commits into
mxhob1 wants to merge 5 commits into
Conversation
Signed-off-by: Michael Hobl <michael@hobl.com.au>
…hods + regenerate mock Signed-off-by: Michael Hobl <michael@hobl.com.au>
…-effort finalizer Signed-off-by: Michael Hobl <michael@hobl.com.au>
…ample manifest Signed-off-by: Michael Hobl <michael@hobl.com.au>
…itive-complexity) Signed-off-by: Michael Hobl <michael@hobl.com.au>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds an
AccessTagCRD + controller to manage Cloudflare Zero Trust Access tags declaratively.Why
Access tags are account-level objects that must exist before an application can reference them. Today the operator only exposes
AccessApplication.spec.tags(assign-only); if a referenced tag does not already exist, Cloudflare rejects the whole application update:There is currently no CRD to create the tag objects, so they have to be created out-of-band via the API before any tagged
AccessApplicationwill sync. This adds the missing declarative piece.What it does
AccessTagCRD (networking.cloudflare-operator.io/v1alpha2), reusingAccessApplication'sCloudflareDetailscredential block. Single required fieldspec.name(the tag string referenced byAccessApplication.spec.tags).app_count == 0. Tags are account-global whileAccessTagCRs are namespaced, so a tag still referenced by an application — or by a siblingAccessTagin another namespace — is never deleted. Teardown is best-effort: a transient Cloudflare error never blocks CR deletion.Implementation
api/v1alpha2/accesstag_types.go(+ generated deepcopy / CRD / RBAC).internal/clients/cf/access_tag.go:CreateAccessTag/GetAccessTag/DeleteAccessTag, thin wrappers overcloudflare-go's nativeAccessTagAPI; added to theCloudflareClientinterface; mock regenerated.internal/controller/accesstag/controller.go: reconciler wired into the manager, mirroring theAccessApplicationcontroller's structure and helpers.Testing
go build ./...,go vet ./...— cleanmake manifests generate— no driftmake test— full suite greenmake lint(golangci-lint --new-from-rev main) — 0 issuesMirrors the
cloudflare_zero_trust_access_tagresource in the Cloudflare Terraform provider.