gocd / kubernetes-elastic-agents

Kubernetes Elastic agent plugin for GoCD
https://www.gocd.org
Apache License 2.0
34 stars 32 forks source link

Remote Configuration in Bitbucket private repo returns 403 #267

Open capitanh opened 2 years ago

capitanh commented 2 years ago

I'm keeping elastic agent configuration in a bitbucket private repo to use the "remote file" option set as: https://[USERNAMER]:[APP_PASSSWORD]@api.bitbucket.org/2.0/repositories/[WORKSPACE]/[REPO]/src/master/[FILENAME] but keep getting a 403-Forbidden response. When I run this exact same request from curl, it works perfectly fine and the remote file is retrieved. Am I doing something wrong or is there a better way of getting remote pod configurations for elastic agents? Thanks for your help

arvindsv commented 2 years ago

Took a quick look and it just uses FileUtils.copyURLToFile. Might be worth checking to see if a non-private URL works.

Looking around, it might be that FileUtils.copyURLToFile doesn't accept a username:password like that in the URL: https://stackoverflow.com/questions/46259498/fileutils-copyurltofile-basicauthenication

capitanh commented 2 years ago

I can confirm that a non-private (public) repo works fine...