Skip to content

Commit 6d5d403

Browse files
committed
Allow the SPIFFE Workload API endpoint to be provided using
`--workload-api-addr` Signed-off-by: Noah Stride <noah.stride@goteleport.com>
1 parent e175544 commit 6d5d403

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cmd/main.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,18 @@ func newX509CredentialProcessCmd() (*cobra.Command, error) {
6161
sessionDuration int
6262
trustAnchorARN string
6363
roleSessionName string
64+
workloadAPIAddr string
6465
)
6566
cmd := &cobra.Command{
6667
Use: "x509-credential-process",
6768
Short: "TODO", // TODO(strideynet): Helpful, short description.
6869
Long: `TODO`, // TODO(strideynet): Helpful, long description.
6970
RunE: func(cmd *cobra.Command, args []string) error {
7071
ctx := cmd.Context()
71-
client, err := workloadapi.New(ctx) // TODO(strideynet): Ability to configure workload api endpoint with flag
72+
client, err := workloadapi.New(
73+
ctx,
74+
workloadapi.WithAddr(workloadAPIAddr),
75+
)
7276
if err != nil {
7377
return fmt.Errorf("creating workload api client: %w", err)
7478
}
@@ -137,5 +141,6 @@ func newX509CredentialProcessCmd() (*cobra.Command, error) {
137141
return nil, fmt.Errorf("marking trust-anchor-arn flag as required: %w", err)
138142
}
139143
cmd.Flags().StringVar(&roleSessionName, "role-session-name", "", "The identifier for the role session. Optional.")
144+
cmd.Flags().StringVar(&workloadAPIAddr, "workload-api-addr", "", "Overrides the address of the Workload API endpoint that will be use to fetch the X509 SVID. If unspecified, the value from the SPIFFE_ENDPOINT_SOCKET environment variable will be used.")
140145
return cmd, nil
141146
}

0 commit comments

Comments
 (0)