Skip to content

Commit

Permalink
fix: service account creation printing extra steps (#1262)
Browse files Browse the repository at this point in the history
* fix: use all alias for cluster connect

* fix: print extra steps when sa is created

* fix: update documentation

* fix: language and message fixes

Co-authored-by: Ben Hardesty <[email protected]>

Co-authored-by: Ben Hardesty <[email protected]>
  • Loading branch information
wtrocki and bhardesty authored Oct 28, 2021
1 parent 6e150b1 commit c0bc7f8
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/commands/rhoas_cluster_connect.adoc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion pkg/cmd/serviceaccount/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,10 @@ func runCreate(opts *options) error {
return fmt.Errorf("%v: %w", opts.localizer.MustLocalize("serviceAccount.common.error.couldNotSaveCredentialsFile"), err)
}

opts.Logger.Info(icon.SuccessPrefix(), opts.localizer.MustLocalize("serviceAccount.common.log.info.credentialsSaved", localize.NewEntry("FilePath", color.CodeSnippet(opts.filename))))
opts.Logger.Info(icon.SuccessPrefix(), opts.localizer.MustLocalize("serviceAccount.common.log.info.credentialsSaved",
localize.NewEntry("FilePath", color.CodeSnippet(opts.filename)),
localize.NewEntry("ClientID", color.Success(creds.ClientID)),
))

return nil
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/localize/locales/en/cmd/cluster.en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ the Service Binding operator (https://github.com/redhat-developer/service-bindin
NOTE: Created service account will need to be given permissions to specified service
For example for Kafka service you should execute the following command to grant access to the service account
$ rhoas kafka acl grant-access --producer --consumer --service-account your-sa --topic "*" --group "*"
$ rhoas kafka acl grant-access --producer --consumer --service-account your-sa --topic all --group all
'''

Expand Down Expand Up @@ -303,7 +303,7 @@ Make a copy of the client ID to store in a safe place. Credentials won't appear
You will need to assign permissions to service account in order to use it.
For example for Kafka service you should execute the following command to grant access to the service account:
$ rhoas kafka acl grant-access --producer --consumer --service-account {{.ClientID}} --topic "*" --group "*"
$ rhoas kafka acl grant-access --producer --consumer --service-account {{.ClientID}} --topic all --group all
'''


Expand Down
13 changes: 12 additions & 1 deletion pkg/localize/locales/en/cmd/serviceaccount.en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,18 @@ other = 'you are forbidden to {{.Operation}} these service accounts'

[serviceAccount.common.log.info.credentialsSaved]
description = 'Credentials file saved message'
one = 'Credentials saved to {{.FilePath}}'
one = '''Credentials saved to {{.FilePath}}
You can now set access rules for your current services.
To grant full access to produce and consume Kafka messages, enter this command:
$ rhoas kafka acl grant-access --producer --consumer --service-account {{.ClientID}} --topic all --group all
To grant read and write access to the currently selected Service Registry instance, enter this command:
$ rhoas service-registry role add --role DEVELOPER --service-account {{.ClientID}}
'''

[serviceAccount.common.input.credentialsFileLocation.message]
description = 'Input message for credentials file location'
Expand Down

0 comments on commit c0bc7f8

Please sign in to comment.