-
Notifications
You must be signed in to change notification settings - Fork 40
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
[template] Allow passing in a template string using RawTemplate #591
base: main
Are you sure you want to change the base?
Conversation
…cret OverrideSecret - secret holding httpd conf snippet to override/extend the vhost endpoint config. Per endpoint vhost all files of the secret gets rendered and placed into /etc/httpd/conf/httpd_override_<key>.conf . In the httpd template at the end of the vhost those templates get included using `Include conf/httpd_override_*.conf`. For information on how sections in httpd configuration get merged, check section "How the sections are merged" in https://httpd.apache.org/docs/current/sections.html#merging Depends-On: openstack-k8s-operators/lib-common#591 Signed-off-by: Martin Schuppert <[email protected]>
…iceConfigSecret This change allows to customize the httpd vhost config using this parameter to specify a secret that contains service config data. The content of each provided snippet gets rendered as a go template and placed into /etc/httpd/conf/httpd_custom_<endpoint>_<key> . At the end of the vhost config in the default httpd template these custom configs get included using `Include conf/httpd_custom_<endpoint>_*`. For information on how sections in httpd configuration get merged, check section "How the sections are merged" in https://httpd.apache.org/docs/current/sections.html#merging Depends-On: openstack-k8s-operators/lib-common#591 Signed-off-by: Martin Schuppert <[email protected]>
modules/common/util/template_util.go
Outdated
for filename, tmplData := range t.AdditionalTemplate { | ||
var renderedTemplate string | ||
var err error | ||
// if tmplData contains either new lines or spaces its expected |
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.
seems very fragile, e.g spaces are valid in file paths.
Could add a new field instead of re-using AdditionalTemplate?
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.
could do that, but I hope we are not using spaces in our templates which are part of our operator images
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.
@olliewalsh changed and introduced a new field RawTemplate
. If you can think of a better naming, let me know :)
5941b19
to
df5302f
Compare
Right all templates are expected to be local files. This change allows passing in optional templates via RawTemplate where the template is a full templace string. Signed-off-by: Martin Schuppert <[email protected]>
df5302f
to
f4bf5c3
Compare
…iceConfigSecret This change allows to customize the httpd vhost config using this parameter to specify a secret that contains service config data. The content of each provided snippet gets rendered as a go template and placed into /etc/httpd/conf/httpd_custom_<endpoint>_<key> . At the end of the vhost config in the default httpd template these custom configs get included using `Include conf/httpd_custom_<endpoint>_*`. For information on how sections in httpd configuration get merged, check section "How the sections are merged" in https://httpd.apache.org/docs/current/sections.html#merging Depends-On: openstack-k8s-operators/lib-common#591 Signed-off-by: Martin Schuppert <[email protected]>
Right all templates are expected to be local files.
This change allows passing in optional templates via
RawTemplate
where the template is a full template string.