This repository has been archived by the owner on Oct 24, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
chore: don't require azure.json on node vms #2849
chore: don't require azure.json on node vms #2849
Changes from 4 commits
8cbd6f4
7761fc1
c2543da
3d9809d
50dc576
d8c862e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Moved this up here to accommodate the "return early if no azure.json" logic. It's not related to the azure.json paving, so can be done in any order.
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.
Ditto moved this up earlier as well.
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.
To be clear, we are not pre-paving
azure.json
for master vms (note that there is no diff tomasternodecustomdata.yml
. The existing code (specificallycat << EOF > "${AZURE_JSON_PATH}"
) works as-is whether or not the file is there (the> "${AZURE_JSON_PATH}"
part). So we are just using the pre-existence ofazure.json
, in a non-master flow only, to determine whether or not we will include theazure.json
on this node. If the "check for file" test fails, we return immediately, because that tells us we aren't includingazure.json
on this node.This works because:
azure.json
on nodes, if needed, prior to paving this file itself (cse_config.sh
in code, and/opt/azure/containers/provision_configs.sh
on the local vm fs)cse_main.sh
before executing code in this file, and because the cloud-initwrite_files
property is a yaml sequence, those will be processed in order. Thus, by the time we are in this execution flow, ifazure.json
should be here, it will be here.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.
Now that we are no longer deleting empty string keys in the
removeKubeletFlags
func we do it here.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.
We don't remove empty string valued keys because they are significant
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 never had UT coverage
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.
Open to a better way to implement this logic. The UT cases below tell the truth in terms of proving that we're doing what we want to do.
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.
The logic could also be stated as:
if all 3 keys exist in the config with a value of empty string
""
return false
else
return true
Right? Just making sure I'm reading it correctly.
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.
Never mind, I read the UT. :-)