Skip to content

Prevent user from changing username with container registry tags

What does this MR do?

Adds validation to prevent a user from changing their username when they have a project with container registry tags, because Namespace#move_dir doesn't work properly in this case.

The check for container registry tags is looking in the new path rather than the old during a user rename, because it happens User#after_update => Namespace#after_update. The container registry stuff doesn't get moved to the new namespace.

Are there points in the code the reviewer needs to double check?

  • I first attempted to fix ContainerRepository#path, but at that point in the transaction, the old path is already lost. So it was simpler to implement the user validation instead
  • Group path changes already fail correctly with registry tags (see screenshot)

Screenshots (if relevant)

Username change with tags

Screen_Shot_2017-08-07_at_3.20.46_PM

Group already works

Screen_Shot_2017-08-07_at_3.24.31_PM

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Fixes #35451 (closed)

Edited by username-removed-1144264

Merge request reports

Loading