Project

General

Profile

Bug #21926

Compute-resource image creation allows duplicate name

Added by Marek Hulán over 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
VM management
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:
Red Hat JIRA:

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 wellResolved

Associated revisions

Revision a186f43b (diff)
Added by Tomer Brisker about 5 years 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 over 5 years ago

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

#2 Updated by The Foreman Bot over 5 years ago

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

#3 Updated by Tomer Brisker over 5 years 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 about 5 years ago

  • Legacy Backlogs Release (now unused) set to 330

#5 Updated by Anonymous about 5 years ago

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

Also available in: Atom PDF