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

Add query for vmSettings #2293

Merged
merged 1 commit into from
Jul 2, 2021
Merged

Add query for vmSettings #2293

merged 1 commit into from
Jul 2, 2021

Conversation

narrieta
Copy link
Member

@narrieta narrieta commented Jul 1, 2021

Adds a query to the Host GA Plugin for vmSettings. Moves _try_update_goal_state from WireClient to UpdateHandler.

@narrieta
Copy link
Member Author

narrieta commented Jul 1, 2021

@jscalev FYI

@@ -788,29 +788,13 @@ def update_goal_state(self, forced=False):
except Exception as exception:
raise ProtocolError("Error processing goal state: {0}".format(ustr(exception)))

def try_update_goal_state(self):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was moved to UpdateHandler

@@ -160,8 +159,6 @@ def daemon(self, child_args=None):
# incarnation number. A forced update ensures the most
# current values.
protocol = self.protocol_util.get_protocol()
if type(protocol) is not WireProtocol:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There used to be 2 protocols: WireProtocol for Azure and MetadataProtocol for Azure Stack. The Metadata protocol was removed some time ago, so this check is no longer needed,

@codecov
Copy link

codecov bot commented Jul 1, 2021

Codecov Report

Merging #2293 (f43e466) into fast-track (b268011) will increase coverage by 0.03%.
The diff coverage is 87.80%.

Impacted file tree graph

@@              Coverage Diff               @@
##           fast-track    #2293      +/-   ##
==============================================
+ Coverage       70.59%   70.62%   +0.03%     
==============================================
  Files              96       96              
  Lines           13904    13917      +13     
  Branches         1986     1986              
==============================================
+ Hits             9815     9829      +14     
+ Misses           3655     3653       -2     
- Partials          434      435       +1     
Impacted Files Coverage Δ
azurelinuxagent/daemon/main.py 71.13% <ø> (+1.13%) ⬆️
azurelinuxagent/common/protocol/hostplugin.py 85.99% <71.42%> (-0.51%) ⬇️
azurelinuxagent/common/protocol/wire.py 78.16% <80.00%> (-0.57%) ⬇️
azurelinuxagent/ga/update.py 87.67% <95.45%> (+0.36%) ⬆️
azurelinuxagent/pa/provision/cloudinit.py 59.25% <100.00%> (ø)
azurelinuxagent/pa/provision/default.py 78.02% <100.00%> (ø)
azurelinuxagent/common/event.py 85.90% <0.00%> (+0.68%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b268011...f43e466. Read the comment docs.

@@ -352,8 +353,33 @@ def _check_threads_running(self, all_thread_handlers):
logger.warn("{0} thread died, restarting".format(thread_handler.get_thread_name()))
thread_handler.start()

def _try_update_goal_state(self, protocol):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move from WireClient, but adds a call to protocol.update_extension_goal_state()

@@ -1892,6 +1895,123 @@ def time(self):
return current_time


class TryUpdateGoalStateTestCase(HttpRequestPredicates, AgentTestCase):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved from test_wire.py, but adds test_it_should_update_the_goal_state

@@ -1205,123 +1204,6 @@ def test_update_goal_state_should_not_persist_the_protected_settings(self):
"Could not find the expected number of redacted settings. Expected {0}.\n{1}".format(len(protected_settings), extensions_config))


class TryUpdateGoalStateTestCase(HttpRequestPredicates, AgentTestCase):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to test_update.py

_HEADER_VERSION: API_VERSION,
_HEADER_CONTAINER_ID: self.container_id,
_HEADER_HOST_CONFIG_NAME: self.role_config_name,
_HEADER_CORRELATION_ID: str(uuid.uuid4()) # TODO: persist correlation ID
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should trace the correlationId to help with debugging.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup, that's the "TODO" part

@narrieta narrieta merged commit 89c1a80 into Azure:fast-track Jul 2, 2021
@narrieta narrieta deleted the vm-settings branch July 2, 2021 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants