Skip to content

Commit

Permalink
reset uphold setting for agent service in flatcar distro (#3066) (#3181)
Browse files Browse the repository at this point in the history
* reset uphold settings for flatcar images

* updated comment

* stop the rebbot service

* address comments

(cherry picked from commit 5759501)

Co-authored-by: Nageswara Nandigam <84482346+nagworld9@users.noreply.github.com>
  • Loading branch information
maddieford and nagworld9 authored Aug 13, 2024
1 parent 80543fd commit 8a0f094
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
19 changes: 19 additions & 0 deletions tests_e2e/orchestrator/scripts/install-agent
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,25 @@ if [[ $(uname -a) == *"flatcar"* ]]; then
if [[ ! -f /usr/share/oem/waagent.conf ]]; then
ln -s "$waagent_conf_path" /usr/share/oem/waagent.conf
fi

# New flatcar images set the uphold property for agent service that is causing automatic restart on stop cmd
# [Upholds= dependency on it has a continuous effect, constantly restarting the unit if necessary]
# Resetting the uphold property as workaround for now
uphold_target=$(systemctl show waagent --property=UpheldBy)
# example output: UpheldBy=multi-user.target
if [[ $uphold_target == *".target"* ]]; then
target_name="${uphold_target#*=}"
if [[ ! -d /etc/systemd/system/$target_name.d ]]; then
mkdir -p /etc/systemd/system/$target_name.d
fi
echo -e "[Unit]\nUpholds=" > /etc/systemd/system/$target_name.d/10-waagent-sysext.conf
systemctl daemon-reload
fi
# Flatcar images does automatic reboot without user input, so turning it off
# Broadcast message from locksmithd at 2024-02-23 19:48:55.478412272 +0000 UTC m=
# System reboot in 5 minutes!
echo "REBOOT_STRATEGY=off" > /etc/flatcar/update.conf
systemctl restart locksmithd
fi

#
Expand Down
7 changes: 6 additions & 1 deletion tests_e2e/test_suites/agent_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,9 @@ locations: "AzureCloud:eastus2euap"
owns_vm: true
skip_on_clouds:
- "AzureChinaCloud"
- "AzureUSGovernment"
- "AzureUSGovernment"
# Since Flatcar read-only filesystem, we can't edit the version file. This test relies on the version to be updated in version file.
# TODO: Enable once we find workaround for this
skip_on_images:
- "flatcar"
- "flatcar_arm64"

0 comments on commit 8a0f094

Please sign in to comment.