-
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
Consume IsVersionFromRSM Property #2934
Changes from all commits
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 |
---|---|---|
|
@@ -295,23 +295,23 @@ def run(self, goal_state): | |
requested_version = self.__get_requested_version(agent_family) | ||
agent_manifest = None # This is to make sure fetch agent manifest once per update | ||
warn_msg = "" | ||
if requested_version is None: | ||
if requested_version is not None and agent_family.is_version_from_rsm: | ||
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. why is this even possible? if RSM is not requesting an update then we would simply get the version from the manifest, right? 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. This condition exactly for that to go to else for doing manifest call. The requested version could None if GS itself don't have it or when we disable the GA versioning. |
||
self._is_requested_version_update = True | ||
# Save the requested version to report back | ||
GAUpdateReportState.report_expected_version = requested_version | ||
# Remove the missing requested version warning once requested version becomes available | ||
if "Missing requested version" in GAUpdateReportState.report_error_msg: | ||
GAUpdateReportState.report_error_msg = "" | ||
else: | ||
# Do not proceed with update if self-update needs to download the manifest again with in an hour | ||
if not self.__should_agent_attempt_manifest_download(): | ||
return | ||
if conf.get_enable_ga_versioning(): # log the warning only when ga versioning is enabled | ||
if conf.get_enable_ga_versioning() and not agent_family.is_version_from_rsm: # log the warning only when ga versioning is enabled | ||
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. but aren't you planning on enabling ga versioning? (and hence this warning would always be there until RSM updates are enabled?) 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. yet, I'll do it in separate PR. We only log the warning when RSM updates are enabled and still missing requested version |
||
warn_msg = "Missing requested version in agent family: {0} for incarnation: {1}, fallback to largest version update".format(self._ga_family, self._gs_id) | ||
GAUpdateReportState.report_error_msg = warn_msg | ||
agent_manifest = goal_state.fetch_agent_manifest(agent_family.name, agent_family.uris) | ||
requested_version = self.__get_largest_version(agent_manifest) | ||
self._is_requested_version_update = False | ||
else: | ||
self._is_requested_version_update = True | ||
# Save the requested version to report back | ||
GAUpdateReportState.report_expected_version = requested_version | ||
# Remove the missing requested version warning once requested version becomes available | ||
if "Missing requested version" in GAUpdateReportState.report_error_msg: | ||
GAUpdateReportState.report_error_msg = "" | ||
|
||
if requested_version == CURRENT_VERSION: | ||
return | ||
|
@@ -338,8 +338,8 @@ def run(self, goal_state): | |
raise AgentUpdateError("The Agent received a request to downgrade to version {0}, but downgrading to a version less than " | ||
"the Agent installed on the image ({1}) is not supported. Skipping downgrade.".format(requested_version, daemon_version)) | ||
|
||
msg = "Goal state {0} is requesting a new agent version {1}, will update the agent before processing the goal state.".format( | ||
self._gs_id, str(requested_version)) | ||
msg = "Goal state {0} is requesting a new agent version {1} [VersionFromRSM:{2}], will update the agent before processing the goal state.".format( | ||
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. change "VersionFromRSM" to something like "Is RSM update"? |
||
self._gs_id, str(requested_version), agent_family.is_version_from_rsm) | ||
self.__log_event(LogLevel.INFO, msg) | ||
|
||
agent = self.__download_and_get_agent(goal_state, agent_family, agent_manifest, requested_version) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<Extensions version="1.0.0.0" goalStateIncarnation="9"><GuestAgentExtension xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> | ||
<GAFamilies> | ||
<GAFamily> | ||
<Name>Prod</Name> | ||
<Version>9.9.9.10</Version> | ||
<IsVersionFromRSM>false</IsVersionFromRSM> | ||
<Uris> | ||
<Uri>http://mock-goal-state/manifest_of_ga.xml</Uri> | ||
</Uris> | ||
</GAFamily> | ||
<GAFamily> | ||
<Name>Test</Name> | ||
<Version>9.9.9.10</Version> | ||
<IsVersionFromRSM>false</IsVersionFromRSM> | ||
<Uris> | ||
<Uri>http://mock-goal-state/manifest_of_ga.xml</Uri> | ||
</Uris> | ||
</GAFamily> | ||
</GAFamilies> | ||
</GuestAgentExtension> | ||
<Plugins> | ||
<Plugin name="OSTCExtensions.ExampleHandlerLinux" version="1.0.0" location="http://mock-goal-state/rdfepirv2hknprdstr03.blob.core.windows.net/b01058962be54ceca550a390fa5ff064/Microsoft.OSTCExtensions_ExampleHandlerLinux_asiaeast_manifest.xml" config="" state="enabled" autoUpgrade="false" failoverlocation="http://mock-goal-state/rdfepirv2hknprdstr04.blob.core.windows.net/b01058962be54ceca550a390fa5ff064/Microsoft.OSTCExtensions_ExampleHandlerLinux_asiaeast_manifest.xml" runAsStartupTask="false" isJson="true" /> | ||
</Plugins> | ||
<PluginSettings> | ||
<Plugin name="OSTCExtensions.ExampleHandlerLinux" version="1.0.0"> | ||
<RuntimeSettings seqNo="0">{"runtimeSettings":[{"handlerSettings":{"protectedSettingsCertThumbprint":"BD447EF71C3ADDF7C837E84D630F3FAC22CCD22F","protectedSettings":"MIICWgYJK","publicSettings":{"foo":"bar"}}}]}</RuntimeSettings> | ||
</Plugin> | ||
</PluginSettings> | ||
<InVMGoalStateMetaData inSvdSeqNo="10" createdOnTicks="637726657706205217" activityId="a33f6f53-43d6-4625-b322-1a39651a00c9" correlationId="9a47a2a2-e740-4bfc-b11b-4f2f7cfe7d2e" /> | ||
<StatusUploadBlob statusBlobType="BlockBlob">https://test.blob.core.windows.net/vhds/test-cs12.test-cs12.test-cs12.status?sr=b&sp=rw&se=9999-01-01&sk=key1&sv=2014-02-14&sig=hfRh7gzUE7sUtYwke78IOlZOrTRCYvkec4hGZ9zZzXo</StatusUploadBlob></Extensions> | ||
|
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.
having is_version_from_rsm and is_requested_version_specified seems redundant/overcomplicated. can we simplify that?