Skip to content

Commit

Permalink
Don't report SF flag idf auto update is disabled (Azure#2754)
Browse files Browse the repository at this point in the history
  • Loading branch information
nagworld9 committed Mar 15, 2023
1 parent 22b8f4e commit 46dbf13
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion azurelinuxagent/common/agent_supported_feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#
# Requires Python 2.6+ and Openssl 1.0+
#
from azurelinuxagent.common import conf


class SupportedFeatureNames(object):
Expand Down Expand Up @@ -74,10 +75,16 @@ def __init__(self):


class _GAVersioningGovernanceFeature(AgentSupportedFeature):
"""
CRP would drive the RSM upgrade version if agent reports that it does support RSM upgrades with this flag otherwise CRP fallback to largest version.
Agent doesn't report supported feature flag if auto update is disabled or old version of agent running that doesn't understand GA versioning.
Note: Especially Windows need this flag to report to CRP that GA doesn't support the updates. So linux adopted same flag to have a common solution.
"""

__NAME = SupportedFeatureNames.GAVersioningGovernance
__VERSION = "1.0"
__SUPPORTED = True
__SUPPORTED = conf.get_autoupdate_enabled()

def __init__(self):
super(_GAVersioningGovernanceFeature, self).__init__(name=self.__NAME,
Expand Down
2 changes: 1 addition & 1 deletion tests/common/test_agent_supported_feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def test_it_should_return_ga_versioning_governance_feature_properly(self):
self.assertIn(SupportedFeatureNames.GAVersioningGovernance, get_agent_supported_features_list_for_crp(),
"GAVersioningGovernance should be fetched in crp_supported_features")

with patch("azurelinuxagent.common.agent_supported_feature._GAVersioningGovernanceFeature.is_supported", False):
with patch("azurelinuxagent.common.conf.get_autoupdate_enabled", return_value=False):
self.assertNotIn(SupportedFeatureNames.GAVersioningGovernance, get_agent_supported_features_list_for_crp(),
"GAVersioningGovernance should not be fetched in crp_supported_features as not supported")

Expand Down

0 comments on commit 46dbf13

Please sign in to comment.