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

adding bugfix and test for persistent volume template #76

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

SethHollandsworth
Copy link
Owner

Andrea found a bug where implicit volumes with volumeClaimTemplates were not being recognized. This adds them as an option and marks them as readonly if "ReadOnlyMany" is used when declaring.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 suggestions.

}
vct_spec = case_insensitive_dict_get(volume_claim_template, "spec")
if vct_spec:
vct_access_modes = case_insensitive_dict_get(vct_spec, "accessModes")
Copy link
Preview

Copilot AI Dec 12, 2024

Choose a reason for hiding this comment

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

Add a null check for vct_access_modes before checking its contents to avoid potential errors.

Suggested change
vct_access_modes = case_insensitive_dict_get(vct_spec, "accessModes")
if vct_access_modes and config.VIRTUAL_NODE_YAML_READ_ONLY_MANY in vct_access_modes:

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
@@ -1104,45 +1106,63 @@ def load_policy_from_virtual_node_yaml_str(
envs += config.VIRTUAL_NODE_ENV_RULES_WORKLOAD_IDENTITY

# command
command = case_insensitive_dict_get(container, "command") or []
command = case_insensitive_dict_get(container, config.VIRTUAL_NODE_YAML_LIFECYCLE_COMMAND) or []
Copy link
Preview

Copilot AI Dec 12, 2024

Choose a reason for hiding this comment

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

The command field should refer to the container's command, not the lifecycle command. Use the correct config field for the container's command.

Suggested change
command = case_insensitive_dict_get(container, config.VIRTUAL_NODE_YAML_LIFECYCLE_COMMAND) or []
command = case_insensitive_dict_get(container, config.VIRTUAL_NODE_YAML_COMMAND) or []

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants