Skip to content

Inject backend defaults in modules#100

Open
mudler wants to merge 8 commits into
masterfrom
fix_diego_fs
Open

Inject backend defaults in modules#100
mudler wants to merge 8 commits into
masterfrom
fix_diego_fs

Conversation

@mudler

@mudler mudler commented Jan 22, 2020

Copy link
Copy Markdown
Contributor

@mudler

mudler commented Jan 22, 2020

Copy link
Copy Markdown
Contributor Author

@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

viccuad commented Feb 3, 2020

Copy link
Copy Markdown
Member

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.

3 participants