Skip to content

Commit

Permalink
skip update if the invite list is empty (#900)
Browse files Browse the repository at this point in the history
Signed-off-by: Ramiro Berrelleza <rberrelleza@gmail.com>
  • Loading branch information
rberrelleza committed Jun 5, 2020
1 parent 0a90e8c commit 8246b6e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions cmd/namespace/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,9 @@ func executeCreateNamespace(ctx context.Context, namespace string, members *[]st

log.Success("Namespace '%s' created", oktetoNS)

if members != nil {
if members != nil && len(*members) > 0 {
if err := okteto.AddNamespaceMembers(ctx, namespace, *members); err != nil {
log.Infof("failed to invite %s to the namespace: %s", strings.Join(*members, ", "), err)
return fmt.Errorf("failed to invite %s to the namespace", strings.Join(*members, ", "))
return fmt.Errorf("failed to invite %s to the namespace: %s", strings.Join(*members, ", "), err)
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/okteto/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func translateAPIErr(err error) error {
return fmt.Errorf("server temporarily unavailable, please try again")
default:
log.Infof("unrecognized API error: %s", err)
return err
return fmt.Errorf(e)
}

}
Expand Down

0 comments on commit 8246b6e

Please sign in to comment.