#2413 add-host should allow also fixing the name when using --force
Opened 3 years ago by tkopecek. Modified 3 years ago

User is created according to host mask. So, we've builder x86-001.build.xyz, but user created wrong way will have name compile/x86-001.build.xyz. So, admin need to know this and call koji add-host --force compile/x86-001.build.xyz x86_64. There is no way to strip the compile prefix. --rename option would be useful here.


Metadata Update from @tkopecek:
- Custom field Size adjusted to None
- Issue set to the milestone: 1.24 (was: 1.23)

3 years ago

Currently the force logic is entirely within the addHost call. We are passed the kerberos principal, so we could look up the user based on that.

We should probably also change the check. If there are two separate users (one with name=hostname and another principal matching the krb arg) then we should probably error and report this. This case shouldn't happen normally and we should probably leave it to an admin to fix with edit-user.

I don't think we technically have to rename the user. Koji doesn't require that the host's user name be equal to the host.name. However, I think it would be reasonable to do if force is given (unless the name is already taken, but that's the case above).

We may also want to handle the case where the user exists, but does not have the principal associated with it. I think it would be reasonable, when force is given, to add the principal to the user (as long as it's not associated to another user yet).

We are passed the kerberos principal, so we could look up the user based on that.

Well we do that, sort of. We call get_user with both name and krb_principal fields in the krb case, which only reports users that match both. This is why we don't find the desired user to use in the original case. I'm suggesting calling it twice, once for each option.

Side note for context: original feature was PR #2042

Metadata Update from @tkopecek:
- Issue set to the milestone: 1.25 (was: 1.24)

3 years ago

Metadata Update from @tkopecek:
- Issue set to the milestone: None (was: 1.25)

3 years ago

Login to comment on this ticket.

Metadata