Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't report SF flag if auto update is disabled #2754

Merged
merged 1 commit into from
Feb 13, 2023
Merged
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
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