Fix 154: adding a finalizer to the tunnel's associated secret#158
Fix 154: adding a finalizer to the tunnel's associated secret#158cyclingwithelephants wants to merge 11 commits intoadyanth:mainfrom
Conversation
5a59e2d to
ab0cbbc
Compare
37ae1d7 to
5e48ba2
Compare
|
Looks like coverage reports are not available from forks |
|
To answer your question, yes the namespace for the cluster tunnel is the operator namespace. |
c6bcca2 to
de18169
Compare
|
Haven't tested yet, but please let me know if you're otherwise happy with the changes |
de18169 to
0a478e6
Compare
adyanth
left a comment
There was a problem hiding this comment.
Couple of suggestions, looks good otherwise!
|
this is functionally working, but I've noticed that the controller is producing errors on deletion. This wasn't happening when using the concrete implementation for the secret. What's strange is that this |
| if apierrors.IsNotFound(err) { | ||
| // Tunnel object not found, could have been deleted after reconcile request. | ||
| // Owned objects are automatically garbage collected. For additional cleanup logic use finalizers. | ||
| // Return and don't requeue | ||
| r.log.Info("Tunnel deleted, nothing to do") | ||
| // Owned objects are automatically garbage collected. | ||
| objectClient, err := k8s.NewObjectClient(r.Client, &r.log) | ||
| if err != nil { | ||
| return ctrl.Result{}, err |
There was a problem hiding this comment.
This logic is in the wrong place (ref: the error you saw). When this condition is hit, the tunnel is already removed from etcd.
What you need is, instead of the logic in both here and tunnel_controller.go, move this to
cloudflare-operator/internal/controller/generic_tunnel_reconciler.go
Lines 157 to 162 in d1570e5
There was a problem hiding this comment.
Oh, derp. Thanks will fix this
There was a problem hiding this comment.
Did you get around to this? Would love to merge this in
There was a problem hiding this comment.
I haven't sorry, life has been a lot this past month! Hoping to get to this next weekend
There was a problem hiding this comment.
Just wanted to give you another heads up, might be another week
Implement comprehensive Cloudflare Zero Trust Kubernetes operator with 18 CRDs: **New CRDs:** - AccessApplication: Zero Trust application definitions - AccessGroup: Reusable access policy groups - AccessIdentityProvider: IdP configurations (OIDC, SAML, GitHub, Azure AD) - AccessServiceToken: Machine-to-machine authentication tokens - VirtualNetwork: Cloudflare virtual networks for traffic isolation - NetworkRoute: IP routes through tunnels to private networks - PrivateService: Expose K8s Services via WARP private IPs - GatewayRule: Gateway DNS/HTTP/network policies - GatewayList: Lists for gateway policy rules - GatewayConfiguration: Global gateway settings - DeviceSettingsPolicy: WARP client settings and split tunnels - DevicePostureRule: Device posture checks for Zero Trust - DNSRecord: DNS record management - WARPConnector: WARP connector deployments **Enhancements:** - Add EnableWarpRouting to Tunnel/ClusterTunnel for private network access - Add cluster-resource-namespace flag with Downward API injection (PR #178) - Store previous-hostnames in TunnelBinding annotation (PR #166) - Fix Secret finalizer order in cleanupTunnel (PR #158) **API Clients:** - Access API: Applications, Groups, Identity Providers, Service Tokens - Gateway API: Rules, Lists, Configurations - Device API: Split Tunnel, Fallback Domains, Posture Rules - Network API: Virtual Networks, Routes - DNS API: Record management 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Release v0.14.0 with Zero Trust CRDs: - 14 new CRDs for Access, Gateway, Device, and Network management - WARP routing support for private network access - Upstream PR fixes (#178, #166, #158) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
fixes #154
I just wanted to confirm that
r.GetTunnel().GetNamespace()for the ClusterTunnel resource is expected to return the cloudflare-operator's namespace? I've tested this working, just wanted to make sure this was built on expected behaviour and wasn't a fluke