Bug 50938

Summary: univention-app reinitialize pulls Docker App image
Product: UCS Reporter: Toni Röhmeyer <roehmeyer>
Component: App CenterAssignee: Jannik Ahlers <ahlers>
Status: CLOSED FIXED QA Contact: Felix Botner <botner>
Severity: minor    
Priority: P5 CC: botner
Version: UCS 4.4   
Target Milestone: UCS 4.4-3-errata   
Hardware: Other   
OS: Linux   
What kind of report is it?: Development Internal What type of bug is this?: ---
Who will be affected by this bug?: --- How will those affected feel about the bug?: ---
User Pain: Enterprise Customer affected?:
School Customer affected?: ISV affected?:
Waiting Support: Flags outvoted (downgraded) after PO Review:
Ticket number: Bug group (optional):
Max CVSS v3 score:

Description Toni Röhmeyer univentionstaff 2020-03-12 13:17:17 CET
The command univention-app reinitialize <app> inherits from univention-app upgrade. 
This leads to an image pull when reinitializing which is not desired.
Comment 1 Toni Röhmeyer univentionstaff 2020-03-12 15:16:00 CET
Reinitialising an app now skips the docker image pull.

Fix pushed on branch origin/4.4-3 with commits:

commit f4dc1fe1836c3ddcc6733d4619efc49ef6ba4a92
Bug #50938: added yaml

commit e47b0f38565c720f3e9e773f02a1c96438cec5aa
Bug #50938: add changelog entry

commit 58b4e6fd72cc92a6b877234a94af038825b63b2e
Bug #50938: reinitialize skips image pull
Comment 2 Dirk Wiesenthal univentionstaff 2020-03-15 12:02:37 CET
Reinitialize works: OK
No pull: OK
YAML: OK
Comment 3 Dirk Wiesenthal univentionstaff 2020-03-15 13:02:45 CET
No, found one thing:

univention-app reinitialize app

on a docker compose app breaks it, as these two lines are not executed anymore. You would need to find a way to call these nevertheless, even if args.pull_image is False.

451 »·······def pull(self):
452 »·······»·······self._setup_env()                             
453 »·······»·······self._setup_yml(recreate=True)                   

I suggest a new method "setup_docker_files()" or something like that. It would call these two lines for Docker Compose Apps and nothing for Docker Apps. You could use it internally for MultiDocker objects wherever recreate=True is used.
Comment 4 Jannik Ahlers univentionstaff 2020-03-16 16:44:02 CET
def5aaee10 Bug #50938: changelog
252f712f9f Bug #50938: make 'univention-app reinitialize' still rebuild docker compose files


Successful build
Package: univention-appcenter
Version: 8.0.11-124A~4.4.0.202003161622
Branch: ucs_4.4-0
Scope: errata4.4-3

- added new function setup_docker_files
- function gets called both by pull and by the reinitialize command
Comment 5 Felix Botner univentionstaff 2020-03-17 09:15:46 CET
I dont understand any of this, but the commit is wrong in the current form. 

self._setup_env fails if called first because is does not create the lib dir, added a mkdir in self.setup_env


653bcde666f3437ed1756938778cf14fa3967faa
Comment 6 Felix Botner univentionstaff 2020-03-17 10:23:53 CET
OK - reinitialize without pull
OK - docker compose reinitialize
OK - test
OK - yaml
Comment 7 Erik Damrose univentionstaff 2020-03-18 12:27:51 CET
<http://errata.software-univention.de/ucs/4.4/485.html>