Skip to content
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

Bug: TunnelConfig.argo.cloudflare.upbound.io missing spec.forProvider.config[].ignressRule[].originRequest #54

Open
milkpirate opened this issue Apr 29, 2024 · 4 comments

Comments

@milkpirate
Copy link

The originRequest in the CRD https://doc.crds.dev/github.com/cdloh/provider-cloudflare/argo.cloudflare.upbound.io/TunnelConfig/v1alpha1@v0.1.0 under ignressRule is missing.

The CF API has it here: https://developers.cloudflare.com/api/operations/cloudflare-tunnel-configuration-put-configuration#request-body, even in the description of ingressRules in your docs there is a link (Read more) to "Origin configuration".

I also checked the TF resource and there it is: https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/tunnel_config#origin_request

It seems like the provider generation from the TF source did not work properly 😢

@milkpirate milkpirate changed the title Bug: TunnelConfig.argo.cloudflare.upbound.io missing spec.forProvider.config[].ignressRule[].originRequest Bug: TunnelConfig.argo.cloudflare.upbound.io missing spec.forProvider.config[].ignressRule[].originRequest Apr 29, 2024
@milkpirate
Copy link
Author

milkpirate commented May 4, 2024

@cdloh Ok, the originRequest seems to have been added to ingressRule with v4.7.0 of terraform-provider-cloudflare. Is it possibel to bump the here used version to at least v4.7.0 or even the latest v4.31.0? Really not sure if

diff --git a/Makefile b/Makefile
index f109ebf..ec89d98 100644
--- a/Makefile
+++ b/Makefile
@@ -8,7 +8,7 @@ export TERRAFORM_VERSION := 1.3.3

 export TERRAFORM_PROVIDER_SOURCE := cloudflare/cloudflare
 export TERRAFORM_PROVIDER_REPO := https://github.com/cloudflare/terraform-provider-cloudflare
-export TERRAFORM_PROVIDER_VERSION := 3.31.0
+export TERRAFORM_PROVIDER_VERSION := 4.31.0
 export TERRAFORM_PROVIDER_DOWNLOAD_NAME := terraform-provider-cloudflare
 export TERRAFORM_NATIVE_PROVIDER_BINARY := terraform-provider-github_v3.31.0
 export TERRAFORM_DOCS_PATH := docs/resources

suffices 😬, #52 does not seem like 🤔

@cdloh
Copy link
Owner

cdloh commented May 6, 2024

Upgrading to v4 requires a significant overhall of the provider. It would require changing all of the internals to support Terraform Framework resources. There is support for it in Upjet but I don't have the time right now to convert all of the bindings here.

I'm happy to accept MRs that upgrade it and do reviews (I can even run tests against a cloudflare account with those entitlements) but can't give you an ETA or anything like that on getting this closer to v4

@milkpirate
Copy link
Author

Ok, I created the provider-cloudflare by the provider template and upjet from v4.31.0 myself. I mostly copied config/* from your repo.

I had to change it a little bit, since they renamed cloudflare_argo_tunnel to cloudflare_tunnel. You can have a look here: https://github.com/milkpirate/provider-cloudflare the image is built and in ghcr.

It would be nice if you can have a look and test it against the said CF account. Havent done any testing so far, just made the pipelines green yesterday.

Please let me know if there are any other changes necessary. I'm just really new to generating providers and this one in particular. I think you know it and its quirks better.

@cdloh
Copy link
Owner

cdloh commented May 7, 2024

This won't work as it's not told to use the new APIs.

You'll need to check out the newer Upjet providers like the AWS one here - https://github.com/crossplane-contrib/provider-upjet-aws/blob/main/config/externalname.go

That loads the TerraformPlugin framework. My understanding is that there ins't much documentation on this yet.

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

No branches or pull requests

2 participants