Skip to content

Commit 72cd259

Browse files
authored
access (#358)
1 parent 7129c54 commit 72cd259

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

app/serviceaccount.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ func NewServiceAccountCommand(getServiceAccountClientFn GetServiceAccountClientF
269269
}
270270
}
271271

272-
var acctActionGroup auth.AccountActionGroup
272+
var access *auth.AccountAccess
273273
if scope == nil {
274274
if len(ctx.String(accountRoleFlagName)) == 0 {
275275
return fmt.Errorf("account role must be specified; valid types are %v", accountActionGroups)
@@ -278,17 +278,17 @@ func NewServiceAccountCommand(getServiceAccountClientFn GetServiceAccountClientF
278278
if err != nil {
279279
return fmt.Errorf("failed to parse account role: %w", err)
280280
}
281-
acctActionGroup = ag
281+
access = &auth.AccountAccess{
282+
Role: ag,
283+
}
282284
} else if scope.Type == auth.SERVICE_ACCOUNT_SCOPE_TYPE_NAMESPACE && len(ctx.String(accountRoleFlagName)) > 0 {
283285
return fmt.Errorf("namespace scoped service accounts may not have an account role")
284286
}
285287

286288
spec := &auth.ServiceAccountSpec{
287289
Name: ctx.String(serviceAccountNameFlagName),
288290
Access: &auth.Access{
289-
AccountAccess: &auth.AccountAccess{
290-
Role: acctActionGroup,
291-
},
291+
AccountAccess: access,
292292
NamespaceAccesses: map[string]*auth.NamespaceAccess{},
293293
},
294294
Description: ctx.String(serviceAccountDescriptionFlagName),

0 commit comments

Comments
 (0)