Project

General

Profile

Actions

Bug #36042

closed

Add validations for RHUI ACS create and update

Added by Quinn James almost 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Alternate Content Sources
Target version:
Fixed in Releases:
Found in Releases:

Description

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

Description of problem:
RHUI ACS supports the 'yum' content-type only. However, we are able to create or update an ACS via hammer or API with the 'file' content-type.

Version-Release number of selected component (if applicable):
6.13.0 snap 5

How reproducible:
always

Steps to Reproduce:
1. Create and RHUI ACS via hammer or API providing file content-type and check the result:

[root@sat ~]# hammer alternate-content-source create --alternate-content-source-type "rhui" --content-type "file" --name "Test RHUI hammer" --base-url "https://rhui.example.com/pulp/content" --subpaths "test/repo1/,test/repo2/" --smart-proxy-ids 1
Alternate Content Source created.

[root@sat ~]# hammer alternate-content-source show --name "Test RHUI hammer"
ID: 191
Name: Test RHUI hammer
Label: Test_RHUI_hammer
Base URL: https://rhui.example.com/pulp/content
Content type: file <-------------------------------------
Alternate content source type: rhui
Subpaths:
1) : test/repo1/
2) : test/repo2/
Smart proxies:
1) Id: 1
Name: satellite.redhat.com
URL: https://satellite.redhat.com:9090
Download policy: on_demand

[root@sat ~]# pulp file acs list
[ {
"pulp_href": "/pulp/api/v3/acs/file/file/0b6ba443-5192-4877-9971-a60f265f3804/",
"pulp_created": "2023-01-18T17:25:03.157620Z",
"name": "Test_RHUI_hammer-https://satellite.redhat.com:9090-397",
"last_refreshed": null,
"paths": [
"test/repo2//PULP_MANIFEST",
"test/repo1//PULP_MANIFEST"
],
"remote": "/pulp/api/v3/remotes/file/file/c14f62dd-5bea-4fc4-b9f3-e98b3bb595ac/"
}
]

2. Try to update the content-type to 'yum' and back to 'file':
curl -sku admin:password -H "Content-type: application/json" -X PUT -d '{"content_type": "file"}' https://$(hostname)/katello/api/alternate_content_sources/191

Actual results:
ACS is created and updated.

Expected results:
There should be some validation to prevent user to do so.
Also 'product-ids' shouldn't be allowed for this ACS type.

Actions #1

Updated by The Foreman Bot almost 2 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/10438 added
Actions #2

Updated by Ian Ballou almost 2 years ago

  • Subject changed from Add validations for RHUI ACS create and update to Add validations for RHUI ACS create and update
  • Category set to Repositories
  • Assignee set to Quinn James
  • Target version set to Katello 4.8.0
  • Triaged changed from No to Yes
Actions #3

Updated by The Foreman Bot almost 2 years ago

  • Fixed in Releases Katello 4.8.0 added
Actions #4

Updated by Anonymous almost 2 years ago

  • Status changed from Ready For Testing to Closed
Actions #5

Updated by The Foreman Bot almost 2 years ago

  • Pull request https://github.com/Katello/katello/pull/10435 added
Actions #6

Updated by Jeremy Lenz almost 2 years ago

  • Category changed from Repositories to Alternate Content Sources
Actions

Also available in: Atom PDF