Skip to content

Commit

Permalink
Pass cmd line env from trcsh. (#1141)
Browse files Browse the repository at this point in the history
  • Loading branch information
joel-rieke committed Jul 5, 2024
1 parent a415bd3 commit d9bb17e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions pkg/cli/trcconfigbase/trcconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,11 @@ func CommonMain(envDefaultPtr *string,
if len(certDestPath) > 1 {
*certDestPathPtr = certDestPath[1]
}
} else if strings.HasPrefix(args, "-env") {
envArgs := strings.Split(args, "=")
if len(envArgs) > 1 {
*envPtr = envArgs[1]
}
}
}
flagset.Parse(nil)
Expand Down
2 changes: 1 addition & 1 deletion pkg/utils/autoUtil.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ func AutoAuth(driverConfig *DriverConfig,
}
}
if driverConfig.CoreConfig.IsShell {
driverConfig.CoreConfig.Log.Printf("Auth connecting to vault @ %s\n", *addrPtr)
driverConfig.CoreConfig.Log.Printf("Auth connecting to vault @ %s and env: %s\n", *addrPtr, *envPtr)
} else {
fmt.Printf("Auth connecting to vault @ %s\n", *addrPtr)
}
Expand Down

0 comments on commit d9bb17e

Please sign in to comment.