Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion e2e/validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -1413,7 +1413,7 @@ func ValidateNodeExporter(ctx context.Context, s *Scenario) {

// Check if node-exporter is installed on this VHD by looking for the skip sentinel file.
// The skip file is only present on VHDs that have node-exporter installed (Ubuntu, Mariner, Azure Linux).
// Flatcar, OSGuard, and older VHDs do not have node-exporter installed and will not have the skip file.
// Flatcar, ACL, OSGuard, and older VHDs do not have node-exporter installed and will not have the skip file.
if !fileExist(ctx, s, skipFile) {
s.T.Logf("Skipping node-exporter validation: sentinel file %s not found (VHD does not have node-exporter installed)", skipFile)
return
Expand Down
2 changes: 1 addition & 1 deletion vhdbuilder/packer/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ while IFS= read -r p; do
;;
"node-exporter")
# Skipping is handled by empty versionsV2 arrays in components.json
# for mariner, flatcar, and osguard. Kata is skipped explicitly here.
# for mariner, flatcar, acl, and osguard. Kata is skipped explicitly here.
if [ "${IS_KATA}" = "true" ]; then
echo "Skipping node-exporter installation for kata (IS_KATA=${IS_KATA})"
else
Expand Down
8 changes: 4 additions & 4 deletions vhdbuilder/packer/packer_source.sh
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,8 @@ copyPackerFiles() {
NODE_EXPORTER_WEB_CONFIG_SRC=/home/packer/node-exporter-web-config.yml
NODE_EXPORTER_WEB_CONFIG_DEST=/etc/node-exporter.d/web-config.yml

# Skip for OSGuard, Flatcar, Kata, and Mariner (only AzureLinux 3.0 gets node-exporter)
if ! { isAzureLinuxOSGuard "$OS" "$OS_VARIANT" || isFlatcar "$OS" || grep -q "kata" <<< "$FEATURE_FLAGS" || isMariner "$OS"; }; then
# Skip for OSGuard, Flatcar, ACL, Kata, and Mariner (only AzureLinux 3.0 gets node-exporter)
if ! { isAzureLinuxOSGuard "$OS" "$OS_VARIANT" || isFlatcar "$OS" || isACL "$OS" || grep -q "kata" <<< "$FEATURE_FLAGS" || isMariner "$OS"; }; then
cpAndMode $NODE_EXPORTER_STARTUP_SRC $NODE_EXPORTER_STARTUP_DEST 755
cpAndMode $NODE_EXPORTER_SERVICE_SRC $NODE_EXPORTER_SERVICE_DEST 644
cpAndMode $NODE_EXPORTER_RESTART_SERVICE_SRC $NODE_EXPORTER_RESTART_SERVICE_DEST 644
Expand Down Expand Up @@ -478,8 +478,8 @@ copyPackerFiles() {
cpAndMode $VHD_CLEANUP_SCRIPT_SRC $VHD_CLEANUP_SCRIPT_DEST 644

# Copy the post-deprovision WALinuxAgent install script and its Python helper
# Skip for Flatcar, which does not manually install WALinuxAgent
if ! isFlatcar "$OS"; then
# Skip for Flatcar and ACL, which do not manually install WALinuxAgent
if ! { isFlatcar "$OS" || isACL "$OS"; }; then
cpAndMode $POST_DEPROVISION_WALINUXAGENT_SRC $POST_DEPROVISION_WALINUXAGENT_DEST 644
cpAndMode $INSTALL_WALINUXAGENT_PY_SRC $INSTALL_WALINUXAGENT_PY_DEST 644
fi
Expand Down
2 changes: 1 addition & 1 deletion vhdbuilder/packer/post-deprovision-walinuxagent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ cleanup() {
trap cleanup EXIT

# Skip on AzureLinux OSGuard which uses its OS-packaged waagent version.
# Flatcar is excluded at the packer config level (its JSON does not call this).
# Flatcar and ACL are excluded at the packer config level (their JSONs do not call this).
OS_VARIANT_ID=$(. /etc/os-release 2>/dev/null && echo "${VARIANT_ID:-}" | tr '[:lower:]' '[:upper:]' | tr -d '"')
if [ "$OS_VARIANT_ID" != "OSGUARD" ]; then

Expand Down
6 changes: 3 additions & 3 deletions vhdbuilder/packer/test/linux-vhd-content-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1571,7 +1571,7 @@ testNodeExporter () {

# Skip check for OS variants that don't have node-exporter, but verify the skip file is NOT present
# Mariner/CBLMariner is skipped - only AzureLinux 3.0 gets node-exporter
if [ "$os_sku" = "AzureLinuxOSGuard" ] || [ "$os_sku" = "Flatcar" ] || [ "$os_sku" = "CBLMariner" ] || echo "$FEATURE_FLAGS" | grep -q "kata"; then
if [ "$os_sku" = "AzureLinuxOSGuard" ] || [ "$os_sku" = "Flatcar" ] || [ "$os_sku" = "AzureContainerLinux" ] || [ "$os_sku" = "CBLMariner" ] || echo "$FEATURE_FLAGS" | grep -q "kata"; then
if [ -f "$skip_file" ]; then
err "$test" "Skip file $skip_file should NOT exist on $os_sku (FEATURE_FLAGS=$FEATURE_FLAGS)"
return 1
Expand Down Expand Up @@ -2100,8 +2100,8 @@ testVHDBuildLogsExist
testCriticalTools
testPackagesInstalled
# WALinuxAgent is installed post-deprovision (not via components.json),
# so test it separately. Skip on Flatcar and AzureLinuxOSGuard which use OS-packaged version.
if [ "$OS_SKU" != "Flatcar" ] && [ "$OS_SKU" != "AzureLinuxOSGuard" ]; then
# so test it separately. Skip on Flatcar, ACL, and AzureLinuxOSGuard which use OS-packaged version.
if [ "$OS_SKU" != "Flatcar" ] && [ "$OS_SKU" != "AzureContainerLinux" ] && [ "$OS_SKU" != "AzureLinuxOSGuard" ]; then
testWALinuxAgentInstalled
fi
testImagesPulled "$(cat $COMPONENTS_FILEPATH)"
Expand Down
30 changes: 30 additions & 0 deletions vhdbuilder/packer/vhd-image-builder-acl.json
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,36 @@
"source": "parts/linux/cloud-init/artifacts/99-azure-network.rules",
"destination": "/home/packer/99-azure-network.rules"
},
{
"type": "file",
"source": "vhdbuilder/packer/install-node-exporter.sh",
"destination": "/home/packer/install-node-exporter.sh"
},
{
"type": "file",
"source": "parts/linux/cloud-init/artifacts/node-exporter/node-exporter-startup.sh",
"destination": "/home/packer/node-exporter-startup.sh"
},
{
"type": "file",
"source": "parts/linux/cloud-init/artifacts/node-exporter/baseline/etc/systemd/system/node-exporter.service",
"destination": "/home/packer/node-exporter.service"
},
{
"type": "file",
"source": "parts/linux/cloud-init/artifacts/node-exporter/baseline/etc/systemd/system/node-exporter-restart.service",
"destination": "/home/packer/node-exporter-restart.service"
},
{
"type": "file",
"source": "parts/linux/cloud-init/artifacts/node-exporter/baseline/etc/systemd/system/node-exporter-restart.path",
"destination": "/home/packer/node-exporter-restart.path"
},
{
"type": "file",
"source": "parts/linux/cloud-init/artifacts/node-exporter/baseline/etc/node-exporter.d/web-config.yml",
"destination": "/home/packer/node-exporter-web-config.yml"
},
{
"type": "shell",
"inline": [
Expand Down
Loading