Project

Profile

Help

Issue #1106

closed

relative_path should be checked for url collision

Added by ipanova@redhat.com almost 9 years ago. Updated about 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
High
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version - OSTree:
Platform Release:
2.8.3
Target Release - OSTree:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

we Cannot allow to have 2 repos with same relative_path

$ pulp-admin -vv ostree repo create --repo-id=123 --feed http://repos.fedorapeople.org/repos/pulp/pulp/demo_repos/zoo/

2015-07-03 15:17:00,628 - DEBUG - sending POST request to /pulp/api/v2/repositories/
2015-07-03 15:17:00,864 - INFO - POST request to /pulp/api/v2/repositories/ with parameters {"display_name": null, "description": null, "distributors": [{"distributor_id": "ostree_web_distributor_name_cli", "auto_publish": true, "distributor_config": {"relative_path": "/repos/pulp/pulp/demo_repos/zoo/"}, "distributor_type_id": "ostree_web_distributor"}], "notes": {"_repo-type": "OSTREE"}, "importer_type_id": "ostree_web_importer", "importer_config": {"feed": "http://repos.fedorapeople.org/repos/pulp/pulp/demo_repos/zoo/", "validate": null}, "id": "123"}
2015-07-03 15:17:00,864 - INFO - Response status : 201 

2015-07-03 15:17:00,865 - INFO - Response body :
 {
  "scratchpad": {}, 
  "display_name": "123", 
  "description": null, 
  "last_unit_added": null, 
  "notes": {
    "_repo-type": "OSTREE"
  }, 
  "last_unit_removed": null, 
  "content_unit_counts": {}, 
  "_ns": "repos", 
  "_id": {
    "$oid": "55968b4c45ef484fc3850979"
  }, 
  "id": "123", 
  "_href": "/pulp/api/v2/repositories/123/"
}

Repository [123] successfully created

[ipanova@ina pulp_ostree]$ pulp-admin -vv ostree repo create --repo-id=321 --feed http://repos.fedorapeople.org/repos/pulp/pulp/demo_repos/zoo/

2015-07-03 15:17:13,816 - DEBUG - sending POST request to /pulp/api/v2/repositories/
2015-07-03 15:17:13,935 - INFO - POST request to /pulp/api/v2/repositories/ with parameters {"display_name": null, "description": null, "distributors": [{"distributor_id": "ostree_web_distributor_name_cli", "auto_publish": true, "distributor_config": {"relative_path": "/repos/pulp/pulp/demo_repos/zoo/"}, "distributor_type_id": "ostree_web_distributor"}], "notes": {"_repo-type": "OSTREE"}, "importer_type_id": "ostree_web_importer", "importer_config": {"feed": "http://repos.fedorapeople.org/repos/pulp/pulp/demo_repos/zoo/", "validate": null}, "id": "321"}
2015-07-03 15:17:13,936 - INFO - Response status : 201 

2015-07-03 15:17:13,936 - INFO - Response body :
 {
  "scratchpad": {}, 
  "display_name": "321", 
  "description": null, 
  "last_unit_added": null, 
  "notes": {
    "_repo-type": "OSTREE"
  }, 
  "last_unit_removed": null, 
  "content_unit_counts": {}, 
  "_ns": "repos", 
  "_id": {
    "$oid": "55968b5945ef484fc385097d"
  }, 
  "id": "321", 
  "_href": "/pulp/api/v2/repositories/321/"
}

Repository [321] successfully created
Actions #1

Updated by bmbouter almost 9 years ago

  • Priority changed from Normal to High
  • Triaged changed from No to Yes

We think this should be handled by platform. In either case, the CLI will need the server side to handle validation and then display the message to the user. It would be good to determine if the other plugins are also affected. If this is not OSTREE specific then discuss the fix with others.

Actions #2

Updated by jortel@redhat.com almost 9 years ago

Currently, I think this is checked by each plugin, or worse, the CLI (and even worse both). The logic for this cannot be to query and see if any other importer configuration already has this path as it is vulnerable to race conditions. Also, The relative publish path is not a standard configuration option. The yum importer uses relative_url (which is not an accurate name of the option) and the ostree plugin uses relative_path (much better, imho).

Three things need to happen in order for the platform to perform this reliably:
- standardize the distributor configuration option.
- switch to postgress.
- add unique constraint on this column.

Although, the override configuration passed in the REST call can still cause publish collisions and cannot be reliably checked.

Until then, we could add support for this check in the ostree plugin but document it as a best effort check and that the caller bares responsibility for collisions. We should also update the yum plugin documentation (if it exists) to the same effect.

Actions #3

Updated by amacdona@redhat.com about 8 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to amacdona@redhat.com
Actions #4

Updated by amacdona@redhat.com about 8 years ago

  • Platform Release set to 2.8.2
Actions #5

Updated by amacdona@redhat.com about 8 years ago

  • Status changed from ASSIGNED to POST

Added by Austin Macdonald about 8 years ago

Revision 76ff7e2c | View on GitHub

Ensure unique relative path at validation time

Checks the relative path of ostree distributors for conflicts.

closes #1106

Actions #6

Updated by Anonymous about 8 years ago

  • Status changed from POST to MODIFIED
  • % Done changed from 0 to 100
Actions #7

Updated by semyers about 8 years ago

  • Platform Release changed from 2.8.2 to 2.8.3
Actions #8

Updated by semyers almost 8 years ago

  • Status changed from MODIFIED to 5
Actions #9

Updated by semyers almost 8 years ago

  • Status changed from 5 to CLOSED - CURRENTRELEASE
Actions #10

Updated by bmbouter about 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF