Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions internal/cmd/compute/access/access.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ func requestCommand() *cobra.Command {
Use: "request",
Short: "Request Compute service access for the current project",
Long: "Submit a request to enable the Compute service for the current " +
"project. Approval may be a manual step by the service provider.",
"project. A self-service Compute service enables access automatically, " +
"normally within a few seconds. Otherwise the request waits for the " +
"service provider to approve it.",
Args: util.NoPositionalArgs,
RunE: func(cmd *cobra.Command, _ []string) error {
project := util.ProjectFromCmd(cmd)
Expand Down Expand Up @@ -111,9 +113,9 @@ func requestCommand() *cobra.Command {
}
util.MarkGateExempt(cmd)

cmd.Flags().StringVar(&message, "message", "", "Justification sent to the service provider with the request")
cmd.Flags().StringVar(&message, "message", "", "Justification for the service provider, read when it approves requests by hand")
cmd.Flags().BoolVar(&renew, "renew", false, "Delete a denied or revoked request and submit a new one")
cmd.Flags().BoolVar(&wait, "wait", false, "Wait until access becomes active (approval is a manual provider step)")
cmd.Flags().BoolVar(&wait, "wait", false, "Wait until Compute setup completes")
cmd.Flags().DurationVar(&timeout, "timeout", 30*time.Minute, "Maximum time to wait when --wait is set")

return cmd
Expand Down
27 changes: 27 additions & 0 deletions internal/cmd/compute/access/access_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package access

import (
"strings"
"testing"
)

func TestRequestHelpDoesNotPromiseManualApproval(t *testing.T) {
cmd := requestCommand()
texts := []string{
cmd.Short,
cmd.Long,
cmd.Flags().Lookup("wait").Usage,
cmd.Flags().Lookup("message").Usage,
}
for _, text := range texts {
lower := strings.ToLower(text)
for _, claim := range []string{"manual", "someone reviews", "a person reviews", "reviews this by hand"} {
if strings.Contains(lower, claim) {
t.Errorf("help says approval is manual (%q): %q", claim, text)
}
}
}
if !strings.Contains(cmd.Long, "self-service") {
t.Errorf("help does not describe self-service access: %q", cmd.Long)
}
}
Loading