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 52995c2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 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
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func main() {
},
{
Name: "oidc",
Usage: "Obtains OIDC information from Buildkite",
Usage: "Interact with Buildkite OIDC",
Subcommands: []cli.Command{
clicommand.OidcTokenCommand,
},
Expand Down

0 comments on commit 52995c2

Please sign in to comment.