Project

General

Profile

Bug #21926

Compute-resource image creation allows duplicate name

Added by Marek Hulán 8 months ago. Updated about 1 month ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
VM management
Target version:
Difficulty:
Triaged:
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1517092

Description of problem: Satellite allows to create compute-resource image with same name.

hammer> compute-resource image list --compute-resource 'rhev_compute'
---|--------|------------------|----------|-------------------------------------
ID | NAME | OPERATING SYSTEM | USERNAME | UUID
---|--------|------------------|----------|-------------------------------------
20 | latest | RedHat 7.3 | root | 09b7babe-4514-4585-9dcc-fbfef071256d
21 | latest | RedHat 7.3 | root | 79ef62d4-1d04-44e0-9e3d-2223529b0253
---|--------|------------------|----------|-------------------------------------

This can be problematic, If there are multiple images with same name. Commands to list info shows Error: found more than one image

hammer> compute-resource image info --compute-resource 'rhev_compute' --name latest --operatingsystem-id 6
Error: found more than one image

Version-Release number of selected component (if applicable): Satellite 6.3 snap 25

How reproducible: always

Steps to Reproduce:
1. compute-resource image create --compute-resource rhev_compute --name 'latest' --username 'root' --password 'password' --architecture 'x86_64' --operatingsystem 'RedHat 7.3' --uuid '<uuid>'

2. compute-resource image create --compute-resource rhev_compute --name 'latest' --username 'root' --password 'password' --architecture 'x86_64' --operatingsystem 'RedHat 7.3' --uuid '<uuid_changed>'

Actual results:

Allows to create compute-resource image with duplicate names.

Expected results:

It should validate and no duplicate/same name images creation should allow.

Additional info: This can be reproduced on WebUI as well.


Related issues

Blocks Foreman - Refactor #21639: unique constraints should be enforced in the DB as wellNew2017-11-13

Associated revisions

Revision a186f43b (diff)
Added by Tomer Brisker 7 months ago

Fixes #21926 - Ensure uniqueness on image names and uuids (#5081)

Image names should be unique per CR and OS. UUID uniqueness is already
enforced by ActiveRecord but not in the DB, which could cause conflicts
in multi-proccess environments. Also cleaned up a bit of the image tests
and made them all use FactoryBot instead of fixtures.

History

#1 Updated by Tomer Brisker 8 months ago

  • Blocks Refactor #21639: unique constraints should be enforced in the DB as well added

#2 Updated by The Foreman Bot 8 months ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/5081 added

#3 Updated by Tomer Brisker 8 months ago

  • Assignee changed from Chris Roberts to Tomer Brisker
  • Subject changed from Compute-resource image creation allows duplicate name to Compute-resource image creation allows duplicate name

#4 Updated by Marek Hulán 7 months ago

  • Legacy Backlogs Release (now unused) set to 330

#5 Updated by Anonymous 7 months ago

  • % Done changed from 0 to 100
  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF