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

chore: Add config defaults #65

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

Conversation

rgibert
Copy link
Member

@rgibert rgibert commented Nov 29, 2024

We have a lot of region_name repetition, this sets defaults that match our configuration so that we can just remove those lines from the configuration.yaml entirely. This will allow us to completely remove the k8s dictionary entirely from our config files.

We have a lot of region_name repitition, this sets defaults that match our configuration so that we can just remove those lines from the configuration.yaml entirely.

Also fixes test_lint failing.
@rgibert rgibert requested a review from nikhars November 29, 2024 21:08
@rgibert rgibert self-assigned this Nov 29, 2024
@rgibert rgibert requested a review from a team as a code owner November 29, 2024 21:08
Comment on lines 71 to 90
root = str(conf["root"]) if conf is not None and "root" in conf else "k8s"

cluster_def_root = (
str(conf["cluster_def_root"])
if conf is not None and "cluster_def_root" in conf
else f"clusters/{region_name}"
)

cluster_name = (
str(conf.get("cluster_name"))
if conf is not None and "cluster_name" in conf
else None
)

materialized_manifests = (
str(conf["materialized_manifests"])
if conf is not None and "materialized_manifests" in conf
else f"materialized_manifests/{region_name}"
)

Copy link
Member

Choose a reason for hiding this comment

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

There are a 4 instances of checks of conf is not None here. Wonder if it would be better to do the conf is None check once and set the required fields in that scenario. Then the other scenarios don't need that check and the code would be easier to comprehend.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ya I was on the fence of the clarity of this vs setting it twice.

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.

2 participants