Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: can now update kafka when only owner #1724

Merged
merged 2 commits into from
Aug 22, 2022
Merged

Conversation

jackdelahunt
Copy link
Contributor

Running rhoas kafka update reauthentication false was not allowed as you needed to be a org admin.

This pr allows for kafka owners to update the kafka reauthentication option and also skips prompt they are not allowed to change as they are not org admins.

Verification Steps

  1. Build main and run rhoas kafka update reauthentication=false when not being org admin, this will fail
  2. Build this branch run rhoas kafka update reauthentication false and should work fine
  3. run rhoas rhoas kafka update and should only be able to change reauthentication an not owner
  4. Do the same as org admin and you can change owner

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)

@jackdelahunt
Copy link
Contributor Author

go.sum changes were from make format and gh actions fails if not included.

@wtrocki
Copy link
Collaborator

wtrocki commented Aug 19, 2022

run rhoas rhoas kafka update and should only be able to change reauthentication an not owner

So backend doesnt allow to change owner? One cannot give their kafka to someone else?

@jackdelahunt
Copy link
Contributor Author

So backend doesn't allow to change owner? One cannot give their kafka to someone else?

Not sure about the actual action itself, but in the implementation that we have we try and select the owner from a list of other people and to get this list it requires to to be org admin.

return err
}
} else {
opts.owner = kafkaInstance.GetOwner()
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should askForNewOwnerName - as opposed to select for admin.
Current logic does assign the same owner.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

as in enter the name directly as the select is for admins only?

Copy link
Collaborator

@wtrocki wtrocki Aug 22, 2022

Choose a reason for hiding this comment

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

Yes.

Long:
Only admins can fetch users but anyone can put username that they know and should be able to give their kafka away.

@jackdelahunt jackdelahunt merged commit 1d7cac9 into main Aug 22, 2022
@jackdelahunt jackdelahunt deleted the kafka-update-fix branch August 22, 2022 09:47
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.

2 participants