Using a Go Binary as a Credential Script for Harvest #3380
rahulguptajss
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Use Case
When running Harvest inside a container, you might encounter environments where tools like
jq
andcurl
are not available. In such cases, you can use a Go binary as a credential script to fetch authentication information. This guide explains how to build and use a Go binary for this purpose.For detailed information on configuring the
credentials_script
, refer to the Harvest documentation.Writing the Go Script
Create a Go file named
main.go
with the following content. Note that this is a sample and you will need to modify it to fetch the relevant password for your use case:Building the Go Binary
Build the Go binary for Linux with the following command:
This command will produce a standalone binary named
get_credentials
that can be executed on a Linux system without requiring the Go framework.Using the Binary in a Container
When running Harvest inside a container, ensure the Go binary is available inside the container. You can achieve this by mounting the binary into the container.
Example Docker compose file:
Beta Was this translation helpful? Give feedback.
All reactions