Configure API token using LinodeClient{}.SetToken(...) rather than transport; allow configuring LINODE_CA#188
Conversation
yec-akamai
left a comment
There was a problem hiding this comment.
The change looks good! However, we probably need to update the test case a bit. I ran the integration test but got current image used to create linode is not valid anymore: https://github.com/linode/docker-volume-linode/blob/main/integration-test/test.yaml#L38
I updated the image to use linode/ubuntu24.04 locally and it passed!
Nice find! I can address that in this PR |
zliang-akamai
left a comment
There was a problem hiding this comment.
Test works well, nice work!
📝 Description
This pull request updates the linodego.Client creation logic to set the user-configured API token using the
LinodeClient{}.SetToken(...)function rather than using a custom oauth2 transport. This allows theLINODE_CAenvironment variable to be specified without any additional logic to set the trusted root CA, which is necessary because linodego can only modify an HTTP client's trusted CAs if the user-provided client's RoundTripper is a *http.Transport.✔️ How to Test
The following test steps assume you have pulled down this PR locally, have Ansible installed, have an SSH public key exported under
~/.ssh/id_rsa.pub, and have a valid Linode API token exported under theLINODE_TOKENenvironment variable.Integration Testing
Manual Testing
TODO