Project

Profile

Help

Story #5028

Updated by bmbouter over 4 years ago

Docker push requires creating a repository version without dispatching a task. This is currently impossible because the RepositoryVersion.create() method always creates a CreatedResource[0]. A CreatedResource requires a task_id to be saved to the database.  

 h3. Solution 

 Have the RepositoryVersion.create() check if it's running inside a task. You can easily do that with Task.current [1]. 

 [0]: https://github.com/pulp/pulpcore/blob/06c7412525c0196169690125eecd63fad3548752/pulpcore/app/models/repository.py#L435 
 [1]: https://github.com/pulp/pulpcore/blob/8c3798cee5935c6c01af0cf83bdea2359926bfad/pulpcore/app/models/task.py#L339-L350 

Back