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

Define includeSelf template rendering function + consider missing default templates empty #218

Merged
merged 11 commits into from
Feb 20, 2024

Conversation

uvegla
Copy link
Contributor

@uvegla uvegla commented Oct 9, 2023

Towards: giantswarm/roadmap#2456

With config split we move the original include folder of the giantswarm/config repository to shared-configs and customer specific config repositories.

In order to support customer specific include files we add support for the include-self directory. Includes from this folder can be imported by the new includeSelf function.

Keeping include and adding includeSelf is better for error reporting and making it clear where the include is coming from instead of supporting fallbacks to find the file and masking error messages on problems.

Example folder structure:

.
├── default
│   └── <ASSEMBLED FROM SAHRED-CONFIGS>
├── include
│   └── <ASSEMBLED FROM SAHRED-CONFIGS>
│   └── example-1.yaml.template
├── include-self
│   └── example-2.yaml.template
└── installations
    └── <MC_NAME>

And usage in config templates:

# Renders: ./include/example-1.yaml.template
{{- include "example-1" }}

# Renders: ./include-self/example-2.yaml.template
{{- includeSelf "example-2" }}

ℹ️ Additionally, missing default app templates are now considered empty instead of raising and error.

Checklist

  • Update changelog in CHANGELOG.md.

uvegla added 7 commits October 9, 2023 12:08
With config split we move the original include folder of the giantswarm/config
repository to be a submodule in customer specific config repositories.

In order to support customer specific include files we add support for the
include-self directory. Includes from this folder can be imported by the new
includeSelf function.

Keeping include and adding includeSelf is better for error reporting and
making it clear where the include is coming from instead of supporting fallbacks
to find the file and masking error messages on problems.
…en secret default template is empty or does not exist
@uvegla uvegla changed the title Define includeSelf template rendering function Define includeSelf template rendering function + consider missing default templates empty Nov 7, 2023
@uvegla uvegla force-pushed the config-split-changes branch from 675c954 to 5ef36c5 Compare November 14, 2023 14:23
@uvegla uvegla marked this pull request as ready for review February 19, 2024 12:27
@uvegla uvegla requested a review from a team as a code owner February 19, 2024 12:27
@uvegla uvegla merged commit f1aa392 into main Feb 20, 2024
5 checks passed
@uvegla uvegla deleted the config-split-changes branch February 20, 2024 08:57
uvegla added a commit to giantswarm/management-cluster-bases that referenced this pull request Feb 20, 2024
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.

1 participant