Skip to content

fix: add plural form for ACL messages#1369

Merged
craicoverflow merged 1 commit intomainfrom
inaccurate-messages
Jan 6, 2022
Merged

fix: add plural form for ACL messages#1369
craicoverflow merged 1 commit intomainfrom
inaccurate-messages

Conversation

@craicoverflow
Copy link
Contributor

The i18n library allows you to pass a number to indicate plurality, so I updated the messages to have a plural and singular form.

Closes #1300

Verification Steps

Plural grant-access

❯ rhoas kafka acl grant-access --producer --consumer --service-account dfgreg --topic enda --group enda
The following ACL rules will be created:

  PRINCIPAL (7)    PERMISSION   OPERATION   DESCRIPTION              
 ---------------- ------------ ----------- ------------------------- 
  dfgreg           allow        describe    topic is "enda"          
  dfgreg           allow        read        topic is "enda"          
  dfgreg           allow        read        group is "enda"          
  dfgreg           allow        write       topic is "enda"          
  dfgreg           allow        create      topic is "enda"          
  dfgreg           allow        write       transactional-id is "*"  
  dfgreg           allow        describe    transactional-id is "*"  

Singular grant-admin

$ rhoas kafka acl grant-admin --all-accounts
The following ACL rule will be created:

  PRINCIPAL      PERMISSION   OPERATION   DESCRIPTION                 
 -------------- ------------ ----------- ---------------------------- 
  All Accounts   allow        alter       cluster is "kafka-cluster"  

Singular delete

$ rhoas kafka acl delete --all-accounts --permission allow --operation describe --cluster
? All ACLs matching the criteria provided will be deleted from the Kafka instance "enda-dev". Are you sure you want to proceed? Yes


✔️  Deleted 1 ACL from Kafka instance "enda-dev"
The following ACL rule was deleted:

  PRINCIPAL      PERMISSION   OPERATION   DESCRIPTION                 
 -------------- ------------ ----------- ---------------------------- 
  All Accounts   allow        describe    cluster is "kafka-cluster"  

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation change
  • Other (please specify)

Checklist

  • Documentation added for the feature
  • CI and all relevant tests are passing
  • Code Review completed
  • Verified independently by reviewer

[kafka.acl.grantPermissions.log.info.aclsPreview]
one = 'The following ACL rule is going to be created:'
one = 'The following ACL rule will be created:'
other = 'The following ACL rules will be created:'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice Pattern!

@wtrocki
Copy link
Collaborator

wtrocki commented Jan 6, 2022

Verified. Good to go!

@craicoverflow craicoverflow merged commit 42c2ea4 into main Jan 6, 2022
@craicoverflow craicoverflow deleted the inaccurate-messages branch January 6, 2022 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inaccurate message when creating multiple ACLs

2 participants