print full Pulumi Cloud stack name in errors for stack select (#3933)

This commit is contained in:
Dominik-K 2020-03-30 21:18:53 +02:00 committed by GitHub
parent 7c08ba4583
commit 77af9e0eac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -709,7 +709,7 @@ func (b *cloudBackend) CreateStack(
// A 409 error response is returned when per-stack organizations are over their limit,
// so we need to look at the message to differentiate.
if strings.Contains(errResp.Message, "already exists") {
return nil, &backend.StackAlreadyExistsError{StackName: stackID.Stack}
return nil, &backend.StackAlreadyExistsError{StackName: stackID.String()}
}
if strings.Contains(errResp.Message, "you are using") {
return nil, &backend.OverStackLimitError{Message: errResp.Message}

View file

@ -53,6 +53,10 @@ type StackIdentifier struct {
Stack string
}
func (s StackIdentifier) String() string {
return fmt.Sprintf("%s/%s/%s", s.Owner, s.Project, s.Stack)
}
// UpdateIdentifier is the set of data needed to identify an update to a Pulumi Cloud stack.
type UpdateIdentifier struct {
StackIdentifier