Skip to content

Commit

Permalink
Don't ignore errors of 'apt-get update' command
Browse files Browse the repository at this point in the history
This change fixes an issue with 'apt-get update' command and stop
container building with erroneous source repositories.

Change-Id: I5ce2eb66a647e1805f086aa37942bf5d13eb4106
Signed-off-by: Maksim Malchuk <[email protected]>
(cherry picked from commit bce06d2)
  • Loading branch information
mmalchuk committed Jun 9, 2022
1 parent 2fbc86f commit 836e594
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion kolla/template/methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def debian_package_install(packages, clean_package_cache=True):

# handle the apt-get install
if reg_packages:
cmds.append('apt-get update')
cmds.append('apt-get --error-on=any update')
cmds.append('apt-get -y install --no-install-recommends {}'.format(
' '.join(reg_packages)
))
Expand Down
10 changes: 10 additions & 0 deletions releasenotes/notes/apt-get-update-fatal-ed2bcc5c1d93c082.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
fixes:
- |
The ``apt-get update`` command by default didn't fail on erroneous source
repositories, it show the warning 'W: Some index files failed to download.
They have been ignored, or old ones used instead.' and continue to work.
This causes some containers (eg. rabbitmq, kolla-toolbox) successfully
built, but makes them inconsistent because the official Ubuntu repository
contains packages with the same names. Now we use ``apt-get -eany update``
command to stop building with an error in such cases.

0 comments on commit 836e594

Please sign in to comment.