Skip to content

Commit 4bda347

Browse files
fmountclaude
andcommitted
Consume common ssl.conf via CommonTemplates field
Use the new CommonTemplates field in the Template struct to request ssl.conf from lib-common instead of shipping a local copy. Co-Authored-By: Claude Opus <noreply@anthropic.com> Signed-off-by: Francesco Pantano <fpantano@redhat.com>
1 parent 46e2c2e commit 4bda347

10 files changed

Lines changed: 20 additions & 39 deletions

File tree

api/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.24.4
44

55
require (
66
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20260513130700-78e1a15a8289
7-
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20260515134210-2e2a0d06648c
7+
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20260518125357-72bdd580c587
88
k8s.io/api v0.31.14
99
k8s.io/apimachinery v0.31.14
1010
sigs.k8s.io/controller-runtime v0.19.7
@@ -36,12 +36,12 @@ require (
3636
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
3737
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
3838
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
39-
github.com/onsi/gomega v1.41.0 // indirect
4039
github.com/pkg/errors v0.9.1 // indirect
4140
github.com/prometheus/client_golang v1.22.0 // indirect
4241
github.com/prometheus/client_model v0.6.2 // indirect
4342
github.com/prometheus/common v0.65.0 // indirect
4443
github.com/prometheus/procfs v0.16.1 // indirect
44+
github.com/rogpeppe/go-internal v1.13.1 // indirect
4545
github.com/spf13/pflag v1.0.7 // indirect
4646
github.com/stretchr/testify v1.11.1 // indirect
4747
github.com/x448/float16 v0.8.4 // indirect

api/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ github.com/onsi/gomega v1.41.0 h1:OwKp4pXNgVxf6sCplzYo794OFNuoL2q2SBMU5NSWOjA=
8080
github.com/onsi/gomega v1.41.0/go.mod h1:M/Uqpu/8qTjtzCLUA2zJHX9Iilrau25x1PdoSRbWh5A=
8181
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20260513130700-78e1a15a8289 h1:c7jcPJt1jINUqWcYhmpeUDzeesOd0SfrFOpxEHHoJ7c=
8282
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20260513130700-78e1a15a8289/go.mod h1:1FRevwpKwNgNjDcd8Rz+mxlRleFsi7gNS0BC09x+oYE=
83-
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20260515134210-2e2a0d06648c h1:tTESojEnTyj5EZ1IlHiTncHqN6Az7iWLBd7sbMDSsEY=
84-
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20260515134210-2e2a0d06648c/go.mod h1:aIuG6lx3aS0vnXweRNdR/Q0SlfOsLIo0OzrqKK7C6xs=
83+
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20260518125357-72bdd580c587 h1:p03uEXoSreyu7LpFmb9YyYM8tEx2D2+7qqhLXNWHTq0=
84+
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20260518125357-72bdd580c587/go.mod h1:JC04T5G4E/he5ukonV1oCqa0QzFkLv761VbLruVghJM=
8585
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
8686
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
8787
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require (
1111
github.com/openstack-k8s-operators/barbican-operator/api v0.0.0-00010101000000-000000000000
1212
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20260513130700-78e1a15a8289
1313
github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20260513130126-175a0958de92
14-
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20260515134210-2e2a0d06648c
14+
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20260518125357-72bdd580c587
1515
github.com/openstack-k8s-operators/lib-common/modules/storage v0.6.1-0.20260515134210-2e2a0d06648c
1616
github.com/openstack-k8s-operators/lib-common/modules/test v0.6.1-0.20260515134210-2e2a0d06648c
1717
github.com/openstack-k8s-operators/mariadb-operator/api v0.6.1-0.20260513143847-4b70b899997a

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20260513130700-7
122122
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20260513130700-78e1a15a8289/go.mod h1:1FRevwpKwNgNjDcd8Rz+mxlRleFsi7gNS0BC09x+oYE=
123123
github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20260513130126-175a0958de92 h1:9brYhCAbx+Cwfq8cEtn/g4xF0w6FlyM7CSuDqertxNQ=
124124
github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20260513130126-175a0958de92/go.mod h1:/nxao9LzRStCZPOpyY61Sbfzcogy5BrEP5nExUwFYZ0=
125-
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20260515134210-2e2a0d06648c h1:tTESojEnTyj5EZ1IlHiTncHqN6Az7iWLBd7sbMDSsEY=
126-
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20260515134210-2e2a0d06648c/go.mod h1:aIuG6lx3aS0vnXweRNdR/Q0SlfOsLIo0OzrqKK7C6xs=
125+
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20260518125357-72bdd580c587 h1:p03uEXoSreyu7LpFmb9YyYM8tEx2D2+7qqhLXNWHTq0=
126+
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20260518125357-72bdd580c587/go.mod h1:JC04T5G4E/he5ukonV1oCqa0QzFkLv761VbLruVghJM=
127127
github.com/openstack-k8s-operators/lib-common/modules/openstack v0.6.1-0.20260506154724-30a976ba8ef0 h1:kMie+G0aHlGwDHjimjj8AUxTl2R7LGfai/8pev2T+TY=
128128
github.com/openstack-k8s-operators/lib-common/modules/openstack v0.6.1-0.20260506154724-30a976ba8ef0/go.mod h1:7yqbVpg0k0vW+kZks+TMU/cd1ovoejyHfVPWcyGYLHI=
129129
github.com/openstack-k8s-operators/lib-common/modules/storage v0.6.1-0.20260515134210-2e2a0d06648c h1:yEjjh0YObWmY0lKqrvBOZpStS832nUrOHvRfDc+t3d0=

internal/controller/barbican_common.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,18 @@ func GenerateConfigsGeneric(
100100
customData map[string]string,
101101
cmLabels map[string]string,
102102
scripts bool,
103+
commonTemplates []string,
103104
) error {
104105
cms := []util.Template{
105106
{
106-
Name: fmt.Sprintf("%s-config-data", instance.GetName()),
107-
Namespace: instance.GetNamespace(),
108-
Type: util.TemplateTypeConfig,
109-
InstanceType: instance.GetObjectKind().GroupVersionKind().Kind,
110-
ConfigOptions: templateParameters,
111-
CustomData: customData,
112-
Labels: cmLabels,
107+
Name: fmt.Sprintf("%s-config-data", instance.GetName()),
108+
Namespace: instance.GetNamespace(),
109+
Type: util.TemplateTypeConfig,
110+
InstanceType: instance.GetObjectKind().GroupVersionKind().Kind,
111+
ConfigOptions: templateParameters,
112+
CustomData: customData,
113+
Labels: cmLabels,
114+
CommonTemplates: commonTemplates,
113115
},
114116
}
115117
if scripts {

internal/controller/barbican_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@ func (r *BarbicanReconciler) generateServiceConfig(
978978
templateParameters["VHosts"] = httpdVhostConfig
979979
templateParameters["TimeOut"] = instance.Spec.APITimeout
980980

981-
return GenerateConfigsGeneric(ctx, h, instance, envVars, templateParameters, customData, labels, true)
981+
return GenerateConfigsGeneric(ctx, h, instance, envVars, templateParameters, customData, labels, true, []string{"ssl.conf"})
982982
}
983983

984984
func (r *BarbicanReconciler) transportURLCreateOrUpdate(

internal/controller/barbicanapi_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ func (r *BarbicanAPIReconciler) generateServiceConfigs(
368368
// This gets overridden in the PKCS11 section below if needed.
369369
templateParameters["PKCS11ClientDataPath"] = barbicanv1beta1.DefaultPKCS11ClientDataPath
370370

371-
return parentOverwrite, GenerateConfigsGeneric(ctx, h, instance, envVars, templateParameters, customData, labels, false)
371+
return parentOverwrite, GenerateConfigsGeneric(ctx, h, instance, envVars, templateParameters, customData, labels, false, []string{"ssl.conf"})
372372
}
373373

374374
func (r *BarbicanAPIReconciler) reconcileInit(

internal/controller/barbicankeystonelistener_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ func (r *BarbicanKeystoneListenerReconciler) generateServiceConfigs(
345345
// To avoid a json parsing error in kolla files, we always need to set PKCS11ClientDataPath
346346
templateParameters["PKCS11ClientDataPath"] = barbicanv1beta1.DefaultPKCS11ClientDataPath
347347

348-
return parentOverwrite, GenerateConfigsGeneric(ctx, h, instance, envVars, templateParameters, customData, labels, false)
348+
return parentOverwrite, GenerateConfigsGeneric(ctx, h, instance, envVars, templateParameters, customData, labels, false, []string{})
349349
}
350350

351351
func (r *BarbicanKeystoneListenerReconciler) reconcileInit(

internal/controller/barbicanworker_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ func (r *BarbicanWorkerReconciler) generateServiceConfigs(
339339
// This gets overridden in the PKCS11 section below if needed.
340340
templateParameters["PKCS11ClientDataPath"] = barbicanv1beta1.DefaultPKCS11ClientDataPath
341341

342-
return parentOverwrite, GenerateConfigsGeneric(ctx, h, instance, envVars, templateParameters, customData, labels, false)
342+
return parentOverwrite, GenerateConfigsGeneric(ctx, h, instance, envVars, templateParameters, customData, labels, false, []string{})
343343
}
344344

345345
func (r *BarbicanWorkerReconciler) reconcileInit(

templates/barbican/config/ssl.conf

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)