Skip to content

Dedup some httpd related templates#694

Merged
stuggi merged 2 commits into
openstack-k8s-operators:mainfrom
fmount:templates
May 18, 2026
Merged

Dedup some httpd related templates#694
stuggi merged 2 commits into
openstack-k8s-operators:mainfrom
fmount:templates

Conversation

@fmount
Copy link
Copy Markdown
Contributor

@fmount fmount commented May 14, 2026

The ssl.conf httpd configuration is duplicated across service operators. Any TLS policy change (cipher suites,
protocol versions) requires coordinated patches across all repositories.
This patch embeds ssl.conf in lib-common via //go:embed and exposes a GetCommonTemplates() function that renders the embedded templates and returns the rendered content.
Service operators can consume this before rendering their config files.
This approach requires no changes in the existing functions/structs and no new abstractions.

Jira: OSPRH-30239

@fultonj
Copy link
Copy Markdown

fultonj commented May 14, 2026

I think this patch and how it's consumed in the following is a good de-duplication

Comment thread modules/common/util/template_util.go
@fmount
Copy link
Copy Markdown
Contributor Author

fmount commented May 18, 2026

@stuggi if you're good with this implementation (see glance and cinder as examples of consuming templates from a common location), I have patches ready for all operators I can push (cc @abays in case you want to take a look at these patches too).

@abays
Copy link
Copy Markdown
Contributor

abays commented May 18, 2026

@fmount I actually looked last week and forgot to say...

/lgtm

Comment thread modules/common/util/template_util.go Outdated
@fmount fmount requested a review from stuggi May 18, 2026 12:27
Copy link
Copy Markdown
Contributor

@stuggi stuggi left a comment

Choose a reason for hiding this comment

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

/lgtm

Signed-off-by: Francesco Pantano <fpantano@redhat.com>
Add a CommonTemplates []string field to the Template struct that allows
service operators to specify which embedded common templates to include.
This avoids injecting common templates (e.g. ssl.conf) into components
that don't need them (e.g. cinder-scheduler, cinder-volume).

Signed-off-by: Francesco Pantano <fpantano@redhat.com>
Copy link
Copy Markdown
Contributor

@stuggi stuggi left a comment

Choose a reason for hiding this comment

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

/lgtm

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.

4 participants