-
Notifications
You must be signed in to change notification settings - Fork 519
fix: automatically get updated apt keys via CSE #2022
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -225,6 +225,21 @@ apt_get_dist_upgrade() { | |
echo Executed apt-get dist-upgrade $i times | ||
wait_for_apt_locks | ||
} | ||
apt_fix_keys() { | ||
retries=10 | ||
output=/tmp/apt-fix-keys.out | ||
for i in $(seq 1 $retries); do | ||
wait_for_apt_locks | ||
! (apt-get update | tee $output | grep NO_PUBKEY) && \ | ||
cat $output && break || \ | ||
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys $(apt-get update | grep NO_PUBKEY -m 1 | awk -F "NO_PUBKEY" '{print $2}') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @palma21 Can we add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if we have a cluster with no egress lock down, I assume it doesn't need apt operation, why we need this whitelist? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My understanding is there are apt sources in the whitelist to allow no egress clusters to update themselves (kernel, azsecpack, etc). If not, then AKS Engine is definitely delivering an apt configuration that doesn't make sense in the no egress scenario. |
||
if [ $i -eq $retries ]; then | ||
return 1 | ||
else sleep 1 | ||
fi | ||
done | ||
echo Executed apt-get update NO_PUBKEY fix $i times | ||
} | ||
systemctl_restart() { | ||
retries=$1; wait_sleep=$2; timeout=$3 svcname=$4 | ||
for i in $(seq 1 $retries); do | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
running two extra
apt-get update
operations in every single CSE (even with VHD) would be a de-optimizationThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current nvidia scenario does not show up in
apt-key list | grep expired
. It's only when you run apt-get update that you are able to derive the key that needs fixing.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in that case should we only do the update in nvidia node? I think doing an update for everyone will take a hit on provisioning latency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's attempting the apt-get update in the background (and it's best-effort, it won't error out), so it won't affect provisioning latency