Skip to content

Inject backend defaults in modules #100

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Inject backend defaults in modules #100

wants to merge 8 commits into from

Conversation

mudler
Copy link
Contributor

@mudler mudler commented Jan 22, 2020

@mudler
Copy link
Contributor Author

mudler commented Jan 22, 2020

@viccuad probably dbb9c9f should apply to other cases too, otherwise whatever we generated during the steps gets ignored and only module's default gets applied

@mudler mudler changed the title Do not setup GARDEN_ROOTFS_DRIVER, just provide sane defaults Inject backend defaults in modules Jan 22, 2020
@viccuad
Copy link
Member

viccuad commented Feb 3, 2020

Thanks for looking into this, and sorry for needing some time before answering!

In theory, backend options do override some modules.
Example, for the global default options and modules/common:

modules/common/defaults.sh contains:

# Default versions in case the are undefined in the backend:
HELM_VERSION="${HELM_VERSION:-v2.16.1}"
KUBECTL_VERSION="${KUBECTL_VERSION:-v1.17.0}"
BAZEL_VERSION="${BAZEL_VERSION:-1.1.0}"

Yet, if any of those vars are defined on the backend, they will take precedence. This is achieved by the first line of the code on modules/common/deps.sh:

. "$ROOT_DIR/backend/$BACKEND/defaults.sh"
. ./defaults.sh
. ../../include/common.sh
. .envrc

This is cumbersome, but at least people reading modules/common/deps.sh and that snippet get an idea of the loading preference. Yet it doesn't use a compiled <buildir>/defaults.sh.

I would like to have a simpler approach, and maybe yours from this PR is it. I would love to save only changed options passed by env var on a different, <buildir>/custom_options.sh, that makes reviewing clusters way easier.

Can you think of an easier way to achieve this?

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