Skip to content

Commit

Permalink
Merge branch 'develop' into fips
Browse files Browse the repository at this point in the history
  • Loading branch information
narrieta authored Jun 14, 2023
2 parents 74d3e32 + 37a014b commit 85d4720
Show file tree
Hide file tree
Showing 32 changed files with 2,271 additions and 1,451 deletions.
23 changes: 22 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 All @@ -23,6 +24,7 @@ class SupportedFeatureNames(object):
MultiConfig = "MultipleExtensionsPerHandler"
ExtensionTelemetryPipeline = "ExtensionTelemetryPipeline"
FastTrack = "FastTrack"
GAVersioningGovernance = "VersioningGovernance" # Guest Agent Versioning


class AgentSupportedFeature(object):
Expand Down Expand Up @@ -72,9 +74,28 @@ def __init__(self):
supported=self.__SUPPORTED)


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 = conf.get_autoupdate_enabled()

def __init__(self):
super(_GAVersioningGovernanceFeature, self).__init__(name=self.__NAME,
version=self.__VERSION,
supported=self.__SUPPORTED)


# This is the list of features that Agent supports and we advertise to CRP
__CRP_ADVERTISED_FEATURES = {
SupportedFeatureNames.MultiConfig: _MultiConfigFeature()
SupportedFeatureNames.MultiConfig: _MultiConfigFeature(),
SupportedFeatureNames.GAVersioningGovernance: _GAVersioningGovernanceFeature()
}


Expand Down
12 changes: 10 additions & 2 deletions azurelinuxagent/common/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ def load_conf_from_file(conf_file_path, conf=__conf__):
"ResourceDisk.EnableSwapEncryption": False,
"AutoUpdate.Enabled": True,
"EnableOverProvisioning": True,
"GAUpdates.Enabled": True,
#
# "Debug" options are experimental and may be removed in later
# versions of the Agent.
Expand Down Expand Up @@ -502,6 +503,14 @@ def get_monitor_network_configuration_changes(conf=__conf__):
return conf.get_switch("Monitor.NetworkConfigurationChanges", False)


def get_ga_updates_enabled(conf=__conf__):
"""
If True, the agent go through update logic to look for new agents otherwise it will stop agent updates.
NOTE: This option is needed in e2e tests to control agent updates.
"""
return conf.get_switch("GAUpdates.Enabled", True)


def get_cgroup_check_period(conf=__conf__):
"""
How often to perform checks on cgroups (are the processes in the cgroups as expected,
Expand Down Expand Up @@ -629,10 +638,9 @@ def get_normal_upgrade_frequency(conf=__conf__):
def get_enable_ga_versioning(conf=__conf__):
"""
If True, the agent uses GA Versioning for auto-updating the agent vs automatically auto-updating to the highest version.
NOTE: This option is experimental and may be removed in later versions of the Agent.
"""
return conf.get_switch("Debug.EnableGAVersioning", False)
return conf.get_switch("Debug.EnableGAVersioning", True)


def get_firewall_rules_log_period(conf=__conf__):
Expand Down
2 changes: 1 addition & 1 deletion azurelinuxagent/common/protocol/goal_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def fetch_extension_manifest(self, extension_name, uris):
def _fetch_manifest(self, manifest_type, name, uris):
try:
is_fast_track = self.extensions_goal_state.source == GoalStateSource.FastTrack
xml_text = self._wire_client.fetch_manifest(uris, use_verify_header=is_fast_track)
xml_text = self._wire_client.fetch_manifest(manifest_type, uris, use_verify_header=is_fast_track)
self._history.save_manifest(name, xml_text)
return ExtensionManifest(xml_text)
except Exception as e:
Expand Down
4 changes: 2 additions & 2 deletions azurelinuxagent/common/protocol/wire.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,8 +582,8 @@ def call_storage_service(http_req, *args, **kwargs):
def fetch_artifacts_profile_blob(self, uri):
return self._fetch_content("artifacts profile blob", [uri], use_verify_header=False)[1] # _fetch_content returns a (uri, content) tuple

def fetch_manifest(self, uris, use_verify_header):
uri, content = self._fetch_content("manifest", uris, use_verify_header=use_verify_header)
def fetch_manifest(self, manifest_type, uris, use_verify_header):
uri, content = self._fetch_content("{0} manifest".format(manifest_type), uris, use_verify_header=use_verify_header)
self.get_host_plugin().update_manifest_uri(uri)
return content

Expand Down
Loading

0 comments on commit 85d4720

Please sign in to comment.