Skip to content

Commit 836e594

Browse files
committed
Don't ignore errors of 'apt-get update' command
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)
1 parent 2fbc86f commit 836e594

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

kolla/template/methods.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def debian_package_install(packages, clean_package_cache=True):
5353

5454
# handle the apt-get install
5555
if reg_packages:
56-
cmds.append('apt-get update')
56+
cmds.append('apt-get --error-on=any update')
5757
cmds.append('apt-get -y install --no-install-recommends {}'.format(
5858
' '.join(reg_packages)
5959
))
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
fixes:
3+
- |
4+
The ``apt-get update`` command by default didn't fail on erroneous source
5+
repositories, it show the warning 'W: Some index files failed to download.
6+
They have been ignored, or old ones used instead.' and continue to work.
7+
This causes some containers (eg. rabbitmq, kolla-toolbox) successfully
8+
built, but makes them inconsistent because the official Ubuntu repository
9+
contains packages with the same names. Now we use ``apt-get -eany update``
10+
command to stop building with an error in such cases.

0 commit comments

Comments
 (0)