Project

Profile

Help

Story #5028

Updated by bmbouter over 3 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 A possible solution would add an optional keyword parameter to 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 

 create() method. This argument would be called 'in_task'. It would default to True. When 'in_task' is set to False, the CreatedResource would not be created.   


 [0] https://github.com/pulp/pulpcore/blob/master/pulpcore/app/models/repository.py#L306

Back