-
Notifications
You must be signed in to change notification settings - Fork 375
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
Implementation of new conf flag AutoUpdate.UpdateToLatestVersion support #3027
Changes from 7 commits
adb897c
d214aa5
8982384
fd34c0c
68ac618
4b94769
5c0f4d2
5261a63
6d6ccd5
41fbdc3
b526bda
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -128,6 +128,7 @@ def load_conf_from_file(conf_file_path, conf=__conf__): | |
"ResourceDisk.EnableSwap": False, | ||
"ResourceDisk.EnableSwapEncryption": False, | ||
"AutoUpdate.Enabled": True, | ||
"AutoUpdate.UpdateToLatestVersion": True, | ||
"EnableOverProvisioning": True, | ||
# | ||
# "Debug" options are experimental and may be removed in later | ||
|
@@ -136,7 +137,6 @@ 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.EnableGAVersioning": True | ||
|
@@ -228,6 +228,11 @@ def get_switch_default_value(option): | |
raise ValueError("{0} is not a valid configuration parameter.".format(option)) | ||
|
||
|
||
def get_switch_no_default_value(key, conf=__conf__): | ||
# If specified, return the value else return None | ||
return conf.get_switch(key, None) | ||
|
||
|
||
def enable_firewall(conf=__conf__): | ||
return conf.get_switch("OS.EnableFirewall", False) | ||
|
||
|
@@ -503,15 +508,19 @@ def get_monitor_network_configuration_changes(conf=__conf__): | |
return conf.get_switch("Monitor.NetworkConfigurationChanges", False) | ||
|
||
|
||
def get_download_new_agents(conf=__conf__): | ||
def get_auto_update_to_latest_version(conf=__conf__): | ||
""" | ||
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 | ||
If set to True, agent will update to the latest version | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should add unit tests that codify these rules: use all combinations of y/n/absent for both flags and check the return value of UpdateToLatestVersion There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. addressed |
||
NOTE: | ||
when both turned on, both AutoUpdate.Enabled and AutoUpdate.UpdateToLatestVersion same meaning: update to latest version | ||
when turned off, AutoUpdate.Enabled: reverts to pre-installed agent, AutoUpdate.UpdateToLatestVersion: uses latest version already installed on the vm and does not download new agents | ||
Even we are deprecating AutoUpdate.Enabled, we still need to support if users explicitly setting it instead new flag. | ||
If AutoUpdate.UpdateToLatestVersion is present, it overrides any value set for AutoUpdate.Enabled (if present). | ||
If AutoUpdate.UpdateToLatestVersion is not present but AutoUpdate.Enabled is present and set to 'n', we adhere to AutoUpdate.Enabled flag's behavior | ||
if both not present, we default to True. | ||
""" | ||
return conf.get_switch("Debug.DownloadNewAgents", True) | ||
default = get_autoupdate_enabled(conf=conf) | ||
return conf.get_switch("AutoUpdate.UpdateToLatestVersion", default) | ||
|
||
|
||
def get_cgroup_check_period(conf=__conf__): | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,7 +75,11 @@ OS.OpensslPath=None | |
OS.SshDir=/etc/ssh | ||
|
||
# Enable or disable goal state processing auto-update, default is enabled | ||
# AutoUpdate.Enabled=y | ||
# When turned off, it remains on latest version installed on the vm | ||
# Added this new option AutoUpdate.UpdateToLatestVersion in place of AutoUpdate.Enabled, and encourage users to transition to this new option | ||
# See wiki[https://github.com/Azure/WALinuxAgent/wiki/FAQ#autoupdateenabled-vs-autoupdateupdatetolatestversion] for more details | ||
# TODO: Update the wiki link and point to readme page or public facing doc | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ideally, I want to point to readme link for flag definition but those changes not there in master yet |
||
# AutoUpdate.UpdateToLatestVersion=y | ||
|
||
# Determine the update family, this should not be changed | ||
# AutoUpdate.GAFamily=Prod | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this function feels a little weird, doesn't it?
Maybe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated