Skip to content

[AKS] Fix ACStor configuration setting detection - #33938

Open
Aditya Pujara (a0x1ab) with Copilot wants to merge 2 commits into
devfrom
copilot/fix-acstor-configuration-detection
Open

[AKS] Fix ACStor configuration setting detection#33938
Aditya Pujara (a0x1ab) with Copilot wants to merge 2 commits into
devfrom
copilot/fix-acstor-configuration-detection

Conversation

Copilot AI commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Related command

az aks create, az aks update

Description

ACStor extension configurationSettings may now persist booleans as lowercase JSON/string values (true/false) instead of "True"/"False". Case-sensitive reads caused az aks update --enable-azure-container-storage to miss active cluster configuration and fall back to legacy defaults.

  • Configuration parsing
    • Added a shared helper to interpret ACStor boolean settings from native bool values and case-insensitive strings.
    • Updated all affected ACStor v1/v2 setting reads to use normalized parsing.
def _is_config_setting_enabled(config_settings, key, default=False):
    value = config_settings.get(key)
    if value is None:
        return default
    if isinstance(value, bool):
        return value
    return str(value).strip().lower() == "true"
  • Regression coverage
    • Added focused tests for lowercase persisted settings and native boolean settings.

Testing Guide

Targeted unit coverage for ACStor helper behavior:

PYTHONPATH=src/azure-cli:src/azure-cli-core /opt/az/bin/python3.14 -m unittest \
  src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_helpers.py

History Notes

[AKS] az aks update: Fix Azure Container Storage configuration detection for lowercase and boolean extension settings


This checklist is used to make sure that common guidelines for a pull request are followed.

@azure-client-tools-bot-prd

Copy link
Copy Markdown

Hi Copilot,
Since the current milestone time is less than 7 days, this pr may not catch up with this release.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@yonzhan

Copy link
Copy Markdown
Collaborator

aks

Co-authored-by: a0x1ab <59631311+a0x1ab@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix ACStor configuration detection for case sensitivity [AKS] Fix ACStor configuration setting detection Aug 20, 2026
@azure-client-tools-agent
azure-client-tools-agent Bot marked this pull request as ready for review August 20, 2026 09:10
@azure-client-tools-agent
azure-client-tools-agent Bot requested a review from a team as a code owner August 20, 2026 09:10
Copilot AI lite review requested due to automatic review settings August 20, 2026 09:10
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes Azure Container Storage (ACStor) configuration detection in az aks create/update by correctly interpreting extension configurationSettings booleans that may be persisted as native JSON booleans or lowercase "true"/"false" strings (instead of only "True"/"False").

Changes:

  • Added a shared helper to normalize ACStor boolean config reads across bool and case-insensitive string representations.
  • Updated ACStor v1/v2 configuration reads to use the normalized helper (eliminating case-sensitive "True" comparisons).
  • Added unit tests covering lowercase boolean strings (v1) and native boolean values (v2).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/azure-cli/azure/cli/command_modules/acs/azurecontainerstorage/_helpers.py Adds _is_config_setting_enabled and updates ACStor config detection to be robust to bool/lowercase string values.
src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_helpers.py Adds regression tests validating correct parsing of lowercase string booleans and native boolean settings.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@azure-client-tools-agent

Copy link
Copy Markdown
Contributor

Live test results — azdev test --live --series (changed test files only)

PASS

Selectors: test_helpers (module)
PR head ref: copilot/fix-acstor-configuration-detection
PR head sha: e07e6866d415907ee1859d07f27f9f15944f60b7
PR base ref: dev
New test files in PR: false

Changed test files run
src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_helpers.py

Workflow run: https://github.com/Azure/issue-sentinel/actions/runs/32352961980

Last 80 lines of azdev output

=============
| Run Tests |
=============


=====================
| Discovering Tests |
=====================

/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py:13705: SyntaxWarning: invalid escape sequence '\]'
  self.cmd('vmss application set -g {rg} -n {vmss} --app-version-ids {vid1} {vid2} --enable-automatic-upgrade True\]', checks=[
/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/identity/tests/latest/test_identity.py:18: SyntaxWarning: invalid escape sequence '\{'
  'resource_restriction_compute': '\{"providers":\["Microsoft.Compute"\]\}',
/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/identity/tests/latest/test_identity.py:19: SyntaxWarning: invalid escape sequence '\{'
  'resource_restriction_empty': '\{"providers":\[\]\}'

test index updated: /home/runner/.azdev/env_config/home/runner/work/issue-sentinel/issue-sentinel/.venv/test_index/latest.json

Test on modules: test_helpers

WARNING: RUNNING TESTS LIVE
The tests are set to run against current profile "latest"
============================= test session starts ==============================
platform linux -- Python 3.12.13, pytest-9.1.1, pluggy-1.6.0 -- /home/runner/work/issue-sentinel/issue-sentinel/.venv/bin/python
cachedir: .pytest_cache
rootdir: /home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli
plugins: forked-1.7.5, xdist-3.8.0
collecting ... collected 25 items

azure-cli/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_helpers.py::DecoratorFunctionsTestCase::test_check_is_apiserver_vnet_integration_cluster PASSED [  4%]
azure-cli/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_helpers.py::DecoratorFunctionsTestCase::test_check_is_managed_aad_cluster PASSED [  8%]
azure-cli/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_helpers.py::DecoratorFunctionsTestCase::test_check_is_msi_cluster PASSED [ 12%]
azure-cli/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_helpers.py::DecoratorFunctionsTestCase::test_check_is_private_cluster PASSED [ 16%]
azure-cli/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_helpers.py::DecoratorFunctionsTestCase::test_check_is_private_link_cluster PASSED [ 20%]
azure-cli/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_helpers.py::DecoratorFunctionsTestCase::test_format_parameter_name_to_option_name PASSED [ 24%]
azure-cli/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_helpers.py::DecoratorFunctionsTestCase::test_get_property_from_dict_or_object PASSED [ 28%]
azure-cli/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_helpers.py::DecoratorFunctionsTestCase::test_safe_list_get PASSED [ 32%]
azure-cli/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_helpers.py::DecoratorFunctionsTestCase::test_safe_lower PASSED [ 36%]
azure-cli/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_helpers.py::AzureContainerStorageHelpersTestCase::test_get_extension_installed_and_cluster_configs_reads_boolean_settings PASSED [ 40%]
azure-cli/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_helpers.py::AzureContainerStorageHelpersTestCase::test_get_extension_installed_and_cluster_configs_v1_reads_lowercase_boolean_strings PASSED [ 44%]
azure-cli/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_helpers.py::ErrorMappingTestCase::test_azure_error PASSED [ 48%]
azure-cli/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_helpers.py::ErrorMappingTestCase::test_http_response_error PASSED [ 52%]
azure-cli/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_helpers.py::ErrorMappingTestCase::test_service_request_error PASSED [ 56%]
azure-cli/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_helpers.py::ErrorMappingTestCase::test_service_response_error PASSED [ 60%]
azure-cli/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_helpers.py::GetSnapShotTestCase::test_get_snapshot PASSED [ 64%]
azure-cli/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_helpers.py::GetSnapShotTestCase::test_get_snapshot_by_snapshot_id PASSED [ 68%]
azure-cli/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_helpers.py::GetUserAssignedIdentityTestCase::test_get_user_assigned_identity PASSED [ 72%]
azure-cli/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_helpers.py::GetUserAssignedIdentityTestCase::test_get_user_assigned_identity_by_resource_id PASSED [ 76%]
azure-cli/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_helpers.py::TestGetMonitoringAddonKey::test_normalizes_camelcase_key PASSED [ 80%]
azure-cli/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_helpers.py::TestGetMonitoringAddonKey::test_normalizes_nonstandard_casing PASSED [ 84%]
azure-cli/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_helpers.py::TestGetMonitoringAddonKey::test_prefers_lowercase_when_both_present PASSED [ 88%]
azure-cli/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_helpers.py::TestGetMonitoringAddonKey::test_returns_default_when_addon_profiles_is_none PASSED [ 92%]
azure-cli/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_helpers.py::TestGetMonitoringAddonKey::test_returns_default_when_key_not_present PASSED [ 96%]
azure-cli/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_helpers.py::TestGetMonitoringAddonKey::test_returns_lowercase_key_when_present PASSED [100%]

- generated xml file: /home/runner/work/issue-sentinel/issue-sentinel/test-output/results.xml -
============================== 25 passed in 1.08s ==============================

Posted by agent-assist live-test workflow.

@azure-client-tools-agent azure-client-tools-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Automated Review Summary

  • Live test: passed (azdev test run via live-test.yml)
  • CI checks: all 105 checks passed, none failing or pending

No issues found. This PR looks ready for a maintainer's final look.

@azure-client-tools-agent azure-client-tools-agent Bot added the azure-client-tools-agent Pull request reviewed by Azure Client Tools Agent label Aug 20, 2026
@microsoft-github-policy-service

Copy link
Copy Markdown
Contributor

🔔 Routing this PR to @Azure/act-observability-squad.

@croomes Simon Croome (croomes) left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving from Container Storage team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

act-observability-squad AKS az aks/acs/openshift Auto-Assign Auto assign by bot azure-client-tools-agent Pull request reviewed by Azure Client Tools Agent

Projects

None yet

7 participants