Skip to content

Commit

Permalink
Adjust help text and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
triarius committed Nov 10, 2022
1 parent 3a7e5dd commit 23f0451
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions clicommand/oidc_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ type OidcTokenConfig struct {
const (
oidcTokenDescription = `Usage:
buildkite-agent oidc token [options]
buildkite-agent oidc token [options...]
Description:
Requests and prints an OIDC token from Buildkite with the specified audience.
Requests and prints an OIDC token from Buildkite that claims the Job ID and
the specified audience. If no audience is specified, the endpoint's default
audience will be claimed.
Example:
$ buildkite-agent oidc token --audience sts.amazonaws.com
Expand All @@ -60,7 +62,7 @@ var OidcTokenCommand = cli.Command{
cli.StringFlag{
Name: "job",
Value: "",
Usage: "Buildkite Job ID",
Usage: "Buildkite Job Id to claim in the OIDC token",
EnvVar: "BUILDKITE_JOB_ID",
},

Expand Down Expand Up @@ -116,9 +118,9 @@ var OidcTokenCommand = cli.Command{
}

token, resp, err = client.OidcToken(cfg.Job, audience...)
// Don't bother retrying if the response was one of these statuses
if resp != nil {
switch resp.StatusCode {
// Don't bother retrying if the response was one of these statuses
case http.StatusUnauthorized | http.StatusForbidden | http.StatusUnprocessableEntity:
r.Break()
return err
Expand Down

0 comments on commit 23f0451

Please sign in to comment.