Closed seboudry closed 3 days ago
@seboudry can you try to rename the provider to follow ^terraform-provider-(?P<type>\w+)_(?P<version>[\w|\\.]+)_(?P<os>[a-z]+)_(?P<arch>[a-z0-9]+)\.zip$
?
Unfortunatly, I think teleport put -bin
as a suffix on all their providers archives.
# grep -e download_url.*teleport-v14.3 /var/run/hermitcrab/data/metadata.db
"download_url": "https://terraform.releases.teleport.dev/store/terraform-provider-teleport-v14.3.3-linux-arm64-bin.zip",
"download_url": "https://terraform.releases.teleport.dev/store/terraform-provider-teleport-v14.3.3-darwin-arm64-bin.zip",
"download_url": "https://terraform.releases.teleport.dev/store/terraform-provider-teleport-v14.3.3-darwin-amd64-bin.zip",
"download_url": "https://terraform.releases.teleport.dev/store/terraform-provider-teleport-v14.3.3-linux-amd64-bin.zip"
If I try request hermitcrab API without -bin
in archive name, I got also a 400 error:
# curl -k --noproxy '*' https://localhost/v1/providers/terraform.releases.teleport.dev/gravitational/teleport/download/terraform-provider-teleport-v14.3.3-linux-amd64.zip
{"message":"invalid archive","status":400,"statusText":"Bad Request"}
I don't think Teleport team will change something on their provider registry so easily.
So, is it possible to accept a suffix and hyphens in archive name?
By modifying the regex like this for example: ^terraform-provider-(?P<type>\w+)[_-](?P<version>[\w|\\.]+)[_-](?P<os>[a-z]+)[_-](?P<arch>[a-z0-9]+)([_-].*)?\.zip$
.
@seboudry https://hub.docker.com/r/sealio/hermitcrab/tags v0.1.5
Thx for your help ;)
But KO unfortunately.
On terraform plan logs:
33 Error while installing terraform.releases.teleport.dev/gravitational/teleport
34 v14.3.3: unsuccessful request to
35 https://burrito-hermitcrab.burrito-system.svc.cluster.local/v1/providers/terraform.releases.teleport.dev/gravitational/teleport/download/terraform-provider-teleport-v14.3.3-linux-amd64-bin.zip:
36 500 Internal Server Error
And on hermitcrab logs:
D api 200 | HTTP/2.0 | 0 B | 1.6 KiB | 626.158µs | 10.171.7.186 | GET /v1/providers/terraform.releases.teleport.dev/gravitational/teleport/index.json
D api 200 | HTTP/2.0 | 0 B | 698 B | 193.974µs | 10.171.7.186 | GET /v1/providers/terraform.releases.teleport.dev/gravitational/teleport/14.3.3.json
E api error requesting GET /v1/providers/terraform.releases.teleport.dev/gravitational/teleport/download/terraform-provider-teleport-v14.3.3-linux-amd64-bin.zip: 1 error occurred:
* version not found
github.com/seal-io/hermitcrab/pkg/apis/runtime.erroring
github.com/seal-io/hermitcrab/pkg/apis/runtime/middleware_error.go:41
github.com/gin-gonic/gin.(*Context).Next
github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/seal-io/hermitcrab/pkg/apis/runtime.recovering
github.com/seal-io/hermitcrab/pkg/apis/runtime/middleware_recovery.go:39
github.com/gin-gonic/gin.(*Context).Next
github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/seal-io/hermitcrab/pkg/apis/runtime.observing
github.com/seal-io/hermitcrab/pkg/apis/runtime/middleware_observation.go:89
github.com/gin-gonic/gin.(*Context).Next
github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
github.com/gin-gonic/gin@v1.9.1/gin.go:620
github.com/gin-gonic/gin.(*Engine).ServeHTTP
github.com/gin-gonic/gin@v1.9.1/gin.go:576
github.com/seal-io/hermitcrab/pkg/apis/runtime.(*Router).ServeHTTP
github.com/seal-io/hermitcrab/pkg/apis/runtime/router.go:191
net/http.serverHandler.ServeHTTP
net/http/server.go:2943
net/http.initALPNRequest.ServeHTTP
net/http/server.go:3551
net/http.(*http2serverConn).runHandler
net/http/h2_bundle.go:6232
D api 500 | HTTP/2.0 | 0 B | 91 B | 179.094µs | 10.171.7.186 | GET /v1/providers/terraform.releases.teleport.dev/gravitational/teleport/download/terraform-provider-teleport-v14.3.3-linux-amd64-bin.zip
I tried to debug a little bit this behavior.
Something weird, is that on file system the providers directory contains only terraform one and not teleport one:
ls /run/hermitcrab/data/providers/
registry.terraform.io
Does some config is needed to define a new registry other than terraform/opentofu?
hi @thxCode! Any insight to go further?
the versioned archives list of teleport
the versioned archives list of a legal provider
The root cause is the version mark of the archive download URL doesn't match the requested version:14.3.3
-> v14.3.3
.
I can fix this here, but I am confused about why teleport doesn't follow the Terraform Release Rules.
@seboudry https://hub.docker.com/r/sealio/hermitcrab/tags v0.1.6
Thanks a lot @thxCode !
It works well with this new release.
I raised an issue on Teleport side: https://github.com/gravitational/teleport/issues/46527.
Hi!
We use teleport provider, and it is hosted at their registry
terraform.releases.teleport.dev
.Requests for available versions and version metadat are working. But the one to download the provider binary returned a 400 error.
Commands executed inside hermitcrab pod:
BTW, we are behind a proxy. Maybe something related with this only for download?