-
Notifications
You must be signed in to change notification settings - Fork 19
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
filter yaml elements #174
filter yaml elements #174
Conversation
gitopscli/commands/sync_apps.py
Outdated
__commit_and_push(team_config_git_repo, root_config_git_repo, git_user, git_email, apps_config_file_name) | ||
|
||
|
||
def __clean_yaml(values: Dict[str, Any]) -> Any: | ||
# storing yaml to allow deletion while iterating |
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.
can you get rid of the comments? If you think you need them, I would extract them to subfunctions and name these accordingly
gitopscli/commands/sync_apps.py
Outdated
from gitopscli.git_api import GitApiConfig, GitRepo, GitRepoApiFactory | ||
from gitopscli.io_api.yaml_util import merge_yaml_element, yaml_file_load | ||
from gitopscli.gitops_exception import GitOpsException | ||
from .command import Command | ||
|
||
# array of allowed values for __clean_yaml function |
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.
get rid of comment, you change variable name if the name itself is not descriptive enough
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.
Thanks for the PR :) But could you please elaborate on what you are trying to achieve? Maybe describe your new feature in the documentation (docs
folder)
for key in values.keys(): | ||
logging.info("processing %s ", key) | ||
# checking if key is in blacklist and remove it if necessary | ||
if key in YAML_BLACKLIST: |
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 list is always empty
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 list is set in case of keywords that would need to be removed. by default it's empty and allow all keywords.
@@ -78,6 +79,9 @@ def setUp(self): | |||
"repository": "https://other-team.config.repo.git", | |||
"applications": {"some-other-app-2": None}, | |||
}, | |||
"/tmp/team-config-repo/my-app/values.yaml": { | |||
"config": {"repository": "https://team.config.repo.git", "applications": {"some-other-app-1": None}} |
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.
Why is there a app/team config yaml in a app/team config repo? We are using app/team config yamls in the root config repo to find app/team config repos: https://baloise.github.io/gitopscli/commands/sync-apps/#root-config-repository
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 implementation answer COP-1705 to have app specific configuration.
As asked , trivial comments had been removed to improve code comprehension |
added function to filter app specific yaml files entries.