Hide Forgot
Created attachment 828773 [details] Test reproducer data. Description of problem: Currently when a content override is created with the same name, but with different case, it is not seen as a duplicate and multiple overrides are created. Since yum will always convert repo properties to lowercase, candlepin should do the same. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: Referencing the attached JSON file (override-case-test.json) and my test candlepin: curl -k -u admin:admin -X PUT -H "Content-Type: application/json" -d @"../override-case-test.json" http://localhost:8080/candlepin/consumers/65d417b0-9ee0-48a1-a152-28efabd07abb/content_overrides/ Actual results: A JSON response with an override for both gpgcheck and GPGCheck [ { "contentLabel" : "my-repo", "name" : "gpgcheck", "value" : "1" }, { "contentLabel" : "test", "name" : "GPGCheck", "value" : "0" } ] Expected results: A JSON response with a single override for gpgcheck (lowercase). ** NOTE: In the case above the values are different. Suggest that the value be set to that of the last override processed. [ { "contentLabel" : "my-repo", "name" : "gpgcheck", "value" : "0" } ] Additional info: We should consider override validation checks in the rules as well to make sure that it always checks the lowercase version of the override name. We can test this by using case variances against trying to override the baseurl property. In the test json provided, changing the 'name' to baseUrl and baseurl should produce an error.
Since this issue was entered in Red Hat Bugzilla, the release flag has been set to ? to ensure that it is properly evaluated for this release.
There is an error in the attached test data JSON file. The 'contentLabel' of both entries should be the same. Here is a corrected version: [ { "contentLabel" : "my-repo", "name" : "gpgcheck", "value" : "1" }, { "contentLabel" : "my-repo", "name" : "GPGCheck", "value" : "0" } ] Expected results will remain the same as in the description.
Follow these steps to test with subscription-manager: Reproduced -------------- [mstead@highside candlepin]$ sudo subscription-manager identity system identity: 41fda330-47f8-42b1-92f8-a8d7c7c6d9e6 name: highside org name: Admin Owner org ID: admin [mstead@highside candlepin]$ sudo subscription-manager repo-override --repo test --add gpgcheck:0 Repository 'test' does not currently exist, but the override has been added. [mstead@highside candlepin]$ sudo subscription-manager repo-override --repo test --add GPGCheck:1 Repository 'test' does not currently exist, but the override has been added. [mstead@highside candlepin]$ sudo subscription-manager repo-override --list Repository: test GPGCheck: 1 gpgcheck: 0 Expected ---------- [mstead@highside candlepin]$ sudo subscription-manager identity system identity: 41fda330-47f8-42b1-92f8-a8d7c7c6d9e6 name: highside org name: Admin Owner org ID: admin [mstead@highside candlepin]$ sudo subscription-manager repo-override --repo test --add gpgcheck:0 Repository 'test' does not currently exist, but the override has been added. [mstead@highside candlepin]$ sudo subscription-manager repo-override --repo test --add GPGCheck:1 Repository 'test' does not currently exist, but the override has been added. [mstead@highside candlepin]$ sudo subscription-manager repo-override --list Repository: test gpgcheck: 1
https://github.com/candlepin/candlepin/pull/483
Closing upstream - devtask