Skip to content

Commit

Permalink
Address feedback
Browse files Browse the repository at this point in the history
- Remove unnecessary check
- Fix description
- Fix some inconsistencies
  • Loading branch information
lawliet89 committed Jun 28, 2021
1 parent 8b3072f commit d8a8d86
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
6 changes: 1 addition & 5 deletions plugin/path_role_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,7 @@ func (b *backend) pathRoleSetRead(ctx context.Context, req *logical.Request, d *
}

func (b *backend) pathRoleSetDelete(ctx context.Context, req *logical.Request, d *framework.FieldData) (resp *logical.Response, err error) {
nameRaw, ok := d.GetOk("name")
if !ok {
return logical.ErrorResponse("name is required"), nil
}
rsName := nameRaw.(string)
rsName := d.Get("name").(string)

b.rolesetLock.Lock()
defer b.rolesetLock.Unlock()
Expand Down
2 changes: 1 addition & 1 deletion plugin/path_static_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func pathStaticAccount(b *backend) *framework.Path {
},
"token_scopes": {
Type: framework.TypeCommaStringSlice,
Description: fmt.Sprintf(`List of OAuth scopes to assign to access tokens generated under this account. Ignored if secret_type not %q`, SecretTypeKey),
Description: fmt.Sprintf(`List of OAuth scopes to assign to access tokens generated under this account. Ignored if "secret_type" is not "%q"`, SecretTypeAccessToken),
},
},
ExistenceCheck: b.pathStaticAccountExistenceCheck,
Expand Down
6 changes: 2 additions & 4 deletions plugin/path_static_account_secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import (

func pathStaticAccountSecretServiceAccountKey(b *backend) *framework.Path {
return &framework.Path{
Pattern: fmt.Sprintf("%s/%s/key", staticAccountPathPrefix, framework.GenericNameRegex("static_account")),
Deprecated: true,
Pattern: fmt.Sprintf("%s/%s/key", staticAccountPathPrefix, framework.GenericNameRegex("static_account")),
Fields: map[string]*framework.FieldSchema{
"static_account": {
Type: framework.TypeString,
Expand Down Expand Up @@ -44,8 +43,7 @@ func pathStaticAccountSecretServiceAccountKey(b *backend) *framework.Path {

func pathStaticAccountSecretAccessToken(b *backend) *framework.Path {
return &framework.Path{
Pattern: fmt.Sprintf("%s/%s/token", staticAccountPathPrefix, framework.GenericNameRegex("static_account")),
Deprecated: true,
Pattern: fmt.Sprintf("%s/%s/token", staticAccountPathPrefix, framework.GenericNameRegex("static_account")),
Fields: map[string]*framework.FieldSchema{
"static_account": {
Type: framework.TypeString,
Expand Down
3 changes: 2 additions & 1 deletion plugin/static_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"errors"
"fmt"

"github.com/hashicorp/errwrap"
"github.com/hashicorp/go-gcp-common/gcputil"
"github.com/hashicorp/go-multierror"
Expand Down Expand Up @@ -110,7 +111,7 @@ func (b *backend) createStaticAccount(ctx context.Context, req *logical.Request,

if err != nil {
if isGoogleAccountNotFoundErr(err) {
return fmt.Errorf("unable to create static account - service account %q should exist", input.serviceAccountEmail)
return fmt.Errorf("unable to create static account, service account %q should exist", input.serviceAccountEmail)
}
return errwrap.Wrapf(fmt.Sprintf("unable to create static account, could not confirm service account %q exists: {{err}}", input.serviceAccountEmail), err)
}
Expand Down

0 comments on commit d8a8d86

Please sign in to comment.