Skip to content

Unable to delete a Tunnel with only API Token set #76

Open
@KAllan357

Description

Hi,

Thanks for this tool! I've set it up and created a tunnel, but came across a potential edge case that I wanted to ask about:

INFO    No API token, or performing delete operation
ERROR    Trying to perform Delete request, or any other request with out APIToken, cannot find API Key or Email
github.com/adyanth/cloudflare-operator/controllers.CloudflareAPI.addAuthHeader
    /workspace/controllers/cloudflare_api.go:85
github.com/adyanth/cloudflare-operator/controllers.(*CloudflareAPI).DeleteCloudflareTunnel
    /workspace/controllers/cloudflare_api.go:157

I'm running version v0.10.0 and was wondering why the code was this way for deletes:

https://github.com/adyanth/cloudflare-operator/blob/v0.10.0/controllers/cloudflare_api.go#L157

It seems like Cloudflare's v4 API supports deleting an Argo Tunnel using the standard Bearer Auth - https://developers.cloudflare.com/api/operations/argo-tunnel-delete-an-argo-tunnel

I see this code was added in f59f153 - maybe Cloudflare changed their API since?

I locally tested this via curl and was successful:
t

curl --request DELETE --url https://api.cloudflare.com/client/v4/accounts/xxxx/tunnels/abc123 -H "Authorization: Bearer <API Token>"
{"success":true ... }

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions