Skip to content

Commit acd2f73

Browse files
authored
Merge pull request #3236 from Azure/hotfix-2.11.1.9
Merge Hotfix 2.11.1.9 (2.11.1.12) to master
2 parents 2b21de5 + 86b0d53 commit acd2f73

File tree

15 files changed

+211
-33
lines changed

15 files changed

+211
-33
lines changed

.github/workflows/ci_pr.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ jobs:
2929

3030
env:
3131
NOSEOPTS: "--verbose"
32-
32+
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
33+
3334
steps:
3435
- uses: actions/checkout@v3
3536

azurelinuxagent/common/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ def has_logrotate():
209209
#
210210
# When doing a release, be sure to use the actual agent version. Current agent version: 2.4.0.0
211211
#
212-
AGENT_VERSION = '2.11.1.4'
212+
AGENT_VERSION = '2.11.1.12'
213213
AGENT_LONG_VERSION = "{0}-{1}".format(AGENT_NAME, AGENT_VERSION)
214214
AGENT_DESCRIPTION = """
215215
The Azure Linux Agent supports the provisioning and running of Linux

azurelinuxagent/ga/exthandlers.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,9 +1417,17 @@ def disable(self, extension=None, ignore_error=False):
14171417
self.report_event(name=self.get_extension_full_name(extension), message=msg, is_success=False,
14181418
log_event=False)
14191419

1420-
# Clean extension state For Multi Config extensions on Disable
1420+
#
1421+
# In the case of multi-config handlers, we keep the state of each extension individually.
1422+
# Disable can be called when the extension is deleted (the extension state in the goal state is set to "disabled"),
1423+
# or as part of the Uninstall and Update sequences. When the extension is deleted, we need to remove its state, along
1424+
# with its status and settings files. Otherwise, we need to set the state to "disabled".
1425+
#
14211426
if self.should_perform_multi_config_op(extension):
1422-
self.__remove_extension_state_files(extension)
1427+
if extension.state == ExtensionRequestedState.Disabled:
1428+
self.__remove_extension_state_files(extension)
1429+
else:
1430+
self.__set_extension_state(extension, ExtensionState.Disabled)
14231431

14241432
# For Single config, dont check enabled_extensions because no extension state is maintained.
14251433
# For MultiConfig, Set the handler state to Installed only when all extensions have been disabled

tests_e2e/orchestrator/docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ RUN \
6767
cd $HOME && \
6868
git clone https://github.com/microsoft/lisa.git && \
6969
cd lisa && \
70-
git checkout 2c16e32001fdefb9572dff61241451b648259dbf && \
70+
git checkout 0e37ed07304b74362cfb3d3c55ac932d3bdc660c && \
7171
\
7272
python3 -m pip install --upgrade pip && \
7373
python3 -m pip install --editable .[azure,libvirt] --config-settings editable_mode=compat && \

tests_e2e/orchestrator/scripts/install-agent

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,25 @@ if [[ $(uname -a) == *"flatcar"* ]]; then
140140
if [[ ! -f /usr/share/oem/waagent.conf ]]; then
141141
ln -s "$waagent_conf_path" /usr/share/oem/waagent.conf
142142
fi
143+
144+
# New flatcar images set the uphold property for agent service that is causing automatic restart on stop cmd
145+
# [Upholds= dependency on it has a continuous effect, constantly restarting the unit if necessary]
146+
# Resetting the uphold property as workaround for now
147+
uphold_target=$(systemctl show waagent --property=UpheldBy)
148+
# example output: UpheldBy=multi-user.target
149+
if [[ $uphold_target == *".target"* ]]; then
150+
target_name="${uphold_target#*=}"
151+
if [[ ! -d /etc/systemd/system/$target_name.d ]]; then
152+
mkdir -p /etc/systemd/system/$target_name.d
153+
fi
154+
echo -e "[Unit]\nUpholds=" > /etc/systemd/system/$target_name.d/10-waagent-sysext.conf
155+
systemctl daemon-reload
156+
fi
157+
# Flatcar images does automatic reboot without user input, so turning it off
158+
# Broadcast message from locksmithd at 2024-02-23 19:48:55.478412272 +0000 UTC m=
159+
# System reboot in 5 minutes!
160+
echo "REBOOT_STRATEGY=off" > /etc/flatcar/update.conf
161+
systemctl restart locksmithd
143162
fi
144163

145164
#

tests_e2e/pipeline/scripts/execute_tests.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ IP_ADDRESS=$(curl -4 ifconfig.io/ip)
7171

7272
# certificate location in the container
7373
AZURE_CLIENT_CERTIFICATE_PATH="/home/waagent/app/cert.pem"
74+
# Need to set this to True if we sue SNI based authentication for certificate
75+
AZURE_CLIENT_SEND_CERTIFICATE_CHAIN="True"
7476

7577
docker run --rm \
7678
--volume "$BUILD_SOURCESDIRECTORY:/home/waagent/WALinuxAgent" \
@@ -80,6 +82,7 @@ docker run --rm \
8082
--env AZURE_CLIENT_ID \
8183
--env AZURE_TENANT_ID \
8284
--env AZURE_CLIENT_CERTIFICATE_PATH=$AZURE_CLIENT_CERTIFICATE_PATH \
85+
--env AZURE_CLIENT_SEND_CERTIFICATE_CHAIN=$AZURE_CLIENT_SEND_CERTIFICATE_CHAIN \
8386
waagenttests.azurecr.io/waagenttests \
8487
bash --login -c \
8588
"lisa \

tests_e2e/test_suites/agent_update.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,9 @@ locations: "AzureCloud:eastus2euap"
1212
owns_vm: true
1313
skip_on_clouds:
1414
- "AzureChinaCloud"
15-
- "AzureUSGovernment"
15+
- "AzureUSGovernment"
16+
# Since Flatcar read-only filesystem, we can't edit the version file. This test relies on the version to be updated in version file.
17+
# TODO: Enable once we find workaround for this
18+
skip_on_images:
19+
- "flatcar"
20+
- "flatcar_arm64"

tests_e2e/test_suites/agent_wait_for_cloud_init.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# This test verifies that the Agent waits for cloud-init to complete before it starts processing extensions.
33
#
44
# NOTE: This test is not fully automated. It requires a custom image where the test Agent has been installed and Extensions.WaitForCloudInit is enabled in waagent.conf.
5-
# To execute it manually, create a custom image and use the 'image' runbook parameter, for example: "-v: image:gallery/wait-cloud-init/1.0.1".
5+
# To execute it manually, create a custom image and use the 'image' runbook parameter, for example: "-v: image:gallery/wait-cloud-init/1.0.2".
66
#
77
name: "AgentWaitForCloudInit"
88
tests:

tests_e2e/tests/agent_publish/agent_publish.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def _get_agent_info(self) -> None:
6262

6363
def _prepare_agent(self) -> None:
6464
log.info("Modifying agent update related config flags and renaming the log file")
65-
self._run_remote_test(self._ssh_client, "sh -c 'agent-service stop && mv /var/log/waagent.log /var/log/waagent.$(date --iso-8601=seconds).log && update-waagent-conf AutoUpdate.UpdateToLatestVersion=y AutoUpdate.GAFamily=Test AutoUpdate.Enabled=y Extensions.Enabled=y'", use_sudo=True)
65+
self._run_remote_test(self._ssh_client, "sh -c 'agent-service stop && mv /var/log/waagent.log /var/log/waagent.$(date --iso-8601=seconds).log && update-waagent-conf AutoUpdate.UpdateToLatestVersion=y AutoUpdate.GAFamily=Test AutoUpdate.Enabled=y Extensions.Enabled=y Debug.EnableGAVersioning=n'", use_sudo=True)
6666
log.info('Renamed log file and updated agent-update DownloadNewAgents GAFamily config flags')
6767

6868
def _check_update(self) -> None:

tests_e2e/tests/agent_wait_for_cloud_init/add_cloud_init_script.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ def update(self, template: Dict[str, Any], is_lisa_template: bool) -> None:
3535
#
3636
# cloud-init configuration needs to be added in the osProfile.customData property as a base64-encoded string.
3737
#
38-
# LISA uses the getOSProfile function to generate the value for osProfile; add customData to its output, checking that we do not
38+
# LISA uses the generateOsProfile function to generate the value for osProfile; add customData to its output, checking that we do not
3939
# override any existing value (the current LISA template does not have any).
4040
#
41-
# "getOSProfile": {
41+
# "generateOsProfile": {
4242
# "parameters": [
4343
# ...
4444
# ],
@@ -55,7 +55,7 @@ def update(self, template: Dict[str, Any], is_lisa_template: bool) -> None:
5555
#
5656
encoded_script = base64.b64encode(AgentWaitForCloudInit.CloudInitScript.encode('utf-8')).decode('utf-8')
5757

58-
get_os_profile = self.get_lisa_function(template, 'getOSProfile')
58+
get_os_profile = self.get_lisa_function(template, 'generateOsProfile')
5959
output = self.get_function_output(get_os_profile)
6060
if output.get('customData') is not None:
6161
raise Exception(f"The getOSProfile function already has a 'customData'. Won't override it. Definition: {get_os_profile}")

0 commit comments

Comments
 (0)