diff --git a/src/go/rpk/pkg/cli/security/user/update.go b/src/go/rpk/pkg/cli/security/user/update.go index a2db9af26eeb4..43e749d1bb859 100644 --- a/src/go/rpk/pkg/cli/security/user/update.go +++ b/src/go/rpk/pkg/cli/security/user/update.go @@ -45,8 +45,9 @@ func newUpdateCommand(fs afero.Fs, p *config.Params) *cobra.Command { } cmd.Flags().StringVar(&newPass, "new-password", "", "New user's password.") - cmd.Flags().StringVar(&mechanism, "mechanism", adminapi.ScramSha256, "SASL mechanism to use for the user you are creating (scram-sha-256, scram-sha-512, case insensitive)") + cmd.Flags().StringVar(&mechanism, "mechanism", adminapi.ScramSha256, "SASL mechanism to use for the user you are updating (scram-sha-256, scram-sha-512, case insensitive)") cmd.MarkFlagRequired("new-password") + cmd.MarkFlagRequired("mechanism") return cmd } diff --git a/tests/rptest/clients/rpk.py b/tests/rptest/clients/rpk.py index 4f123704ab86b..11c9e02caba67 100644 --- a/tests/rptest/clients/rpk.py +++ b/tests/rptest/clients/rpk.py @@ -528,10 +528,11 @@ def sasl_create_user_basic_mix(self, return self._run(cmd) - def sasl_update_user(self, user, new_password): + def sasl_update_user(self, user, new_password, new_mechanism): cmd = [ "acl", "user", "update", user, "--new-password", new_password, - "-X", "admin.hosts=" + self._redpanda.admin_endpoints() + "--mechanism", new_mechanism, "-X", + "admin.hosts=" + self._redpanda.admin_endpoints() ] return self._run(cmd) diff --git a/tests/rptest/tests/rpk_acl_test.py b/tests/rptest/tests/rpk_acl_test.py index 029cf51aece8f..0f45d7d26811e 100644 --- a/tests/rptest/tests/rpk_acl_test.py +++ b/tests/rptest/tests/rpk_acl_test.py @@ -123,7 +123,8 @@ def test_create_update(self): # We check that we can list the topics: assert topic in topic_list - out = self._rpk.sasl_update_user(self.username, new_password) + out = self._rpk.sasl_update_user(self.username, new_password, + self.mechanism) assert f'Updated user "{self.username}" successfully' in out with expect_exception(