Open afarbos opened 4 years ago
Like cloudsql-proxy and many other go binaries, it usually possible to import them within your own go applications. This PR would allow a similar behavior with daytona too, see example below:
package main import ( "fmt" "log" "os" "strings" cfg "github.com/cruise-automation/daytona/pkg/config" "github.com/cruise-automation/daytona/pkg/daytona" ) func main() { os.Setenv("VAULT_SECRETS_FOO_BAR", "secret/foo/bar/") config := cfg.DefaultConfig() config.AWSAuth = true config.SecretEnv = true config.VaultAuthRoleName = "awesome-app-vault-role-name" if err := daytona.Run(config); err != nil { log.Fatalln(err.Error()) } fmt.Println("== env ==") for _, e := range os.Environ() { pair := strings.SplitN(e, "=", 2) fmt.Println(pair[0]) } }
A lot of changes are just moving code, there is not actually so much changes more than creating the daytona package.
Like cloudsql-proxy and many other go binaries, it usually possible to import them within your own go applications. This PR would allow a similar behavior with daytona too, see example below:
A lot of changes are just moving code, there is not actually so much changes more than creating the daytona package.