Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nagworld9 committed Jun 29, 2023
1 parent c3b3247 commit d02c4fb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
16 changes: 9 additions & 7 deletions azurelinuxagent/common/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ def load_conf_from_file(conf_file_path, conf=__conf__):
"Debug.CgroupLogMetrics": False,
"Debug.CgroupDisableOnProcessCheckFailure": True,
"Debug.CgroupDisableOnQuotaCheckFailure": True,
"Debug.DownloadNewAgents": True,
"Debug.EnableAgentMemoryUsageCheck": False,
"Debug.EnableFastTrack": True,
"Debug.EnableGAUpdates": True,
"Debug.EnableGAVersioning": True
}

Expand Down Expand Up @@ -503,13 +503,15 @@ def get_monitor_network_configuration_changes(conf=__conf__):
return conf.get_switch("Monitor.NetworkConfigurationChanges", False)


def get_ga_updates_enabled(conf=__conf__):
def get_download_new_agents(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 same like Autoupdates flag but one difference is that this will not influence the daemon to start the ext_handler of daemon(installed with image) version.
and it is used especially when you don't want to change the agent from a particular version
If True, the agent go through update logic to look for new agents to download otherwise it will stop agent updates.
NOTE: AutoUpdate.Enabled controls whether the Agent downloads new update and also whether any downloaded updates are started or not, while DownloadNewAgents controls only the former.
AutoUpdate.Enabled == false -> Agent preinstalled on the image will process extensions and will not update (regardless of DownloadNewAgents flag)
AutoUpdate.Enabled == true and DownloadNewAgents == true, any update already downloaded will be started, and agent look for future updates
AutoUpdate.Enabled == true and DownloadNewAgents == false, any update already downloaded will be started, but the agent will not look for future updates
"""
return conf.get_switch("Debug.EnableGAUpdates", True)
return conf.get_switch("Debug.DownloadNewAgents", True)


def get_cgroup_check_period(conf=__conf__):
Expand Down Expand Up @@ -638,7 +640,7 @@ def get_normal_upgrade_frequency(conf=__conf__):

def get_enable_ga_versioning(conf=__conf__):
"""
If True, the agent look for rsm updates(checking requested version in GS) otherwise it will fall back to self-update and finds the highest version from PIR.
If True, the agent looks for rsm updates(checking requested version in GS) otherwise it will fall back to self-update and finds the highest version from PIR.
NOTE: This option is experimental and may be removed in later versions of the Agent.
"""
return conf.get_switch("Debug.EnableGAVersioning", True)
Expand Down
2 changes: 1 addition & 1 deletion azurelinuxagent/ga/agent_update_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def __log_event(level, msg, success=True):
def run(self, goal_state):
try:
# Ignore new agents if update is disabled. The latter flag only used in e2e tests.
if not self._autoupdate_enabled or not conf.get_ga_updates_enabled():
if not self._autoupdate_enabled or not conf.get_download_new_agents():
return

self._gs_id = goal_state.extensions_goal_state.id
Expand Down
2 changes: 1 addition & 1 deletion tests/test_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
Debug.CgroupLogMetrics = False
Debug.CgroupMonitorExpiryTime = 2022-03-31
Debug.CgroupMonitorExtensionName = Microsoft.Azure.Monitor.AzureMonitorLinuxAgent
Debug.DownloadNewAgents = True
Debug.EnableAgentMemoryUsageCheck = False
Debug.EnableFastTrack = True
Debug.EnableGAUpdates = True
Debug.EnableGAVersioning = True
Debug.EtpCollectionPeriod = 300
Debug.FirewallRulesLogPeriod = 86400
Expand Down
2 changes: 1 addition & 1 deletion tests_e2e/orchestrator/scripts/install-agent
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ echo "Agent's conf path: $waagent_conf_path"
sed -i 's/AutoUpdate.Enabled=n/AutoUpdate.Enabled=y/g' "$waagent_conf_path"
# By default GAUpdates flag set to True, so that agent go through update logic to look for new agents.
# But in e2e tests this flag needs to be off in test version 9.9.9.9 to stop the agent updates, so that our scenarios run on 9.9.9.9.
sed -i '$a Debug.EnableGAUpdates=n' "$waagent_conf_path"
sed -i '$a Debug.DownloadNewAgents=n' "$waagent_conf_path"

#
# Restart the service
Expand Down

0 comments on commit d02c4fb

Please sign in to comment.