Skip to content

Commit 014e0ee

Browse files
committed
[tlse] memcached tls client config
Depends-On: openstack-k8s-operators/infra-operator#192 Jira: OSPRH-5283
1 parent c2e2433 commit 014e0ee

File tree

3 files changed

+7
-26
lines changed

3 files changed

+7
-26
lines changed

controllers/cinder_controller.go

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,10 @@ package controllers
1919
import (
2020
"context"
2121
"fmt"
22-
"strings"
2322
"time"
2423

2524
k8s_errors "k8s.io/apimachinery/pkg/api/errors"
2625
"k8s.io/apimachinery/pkg/runtime"
27-
"k8s.io/apimachinery/pkg/types"
2826
"k8s.io/client-go/kubernetes"
2927
ctrl "sigs.k8s.io/controller-runtime"
3028
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -500,7 +498,7 @@ func (r *CinderReconciler) reconcileNormal(ctx context.Context, instance *cinder
500498
//
501499
// Check for required memcached used for caching
502500
//
503-
memcached, err := r.getCinderMemcached(ctx, helper, instance)
501+
memcached, err := memcachedv1.GetMemcachedByName(ctx, helper, instance.Spec.MemcachedInstance, instance.Namespace)
504502
if err != nil {
505503
if k8s_errors.IsNotFound(err) {
506504
instance.Status.Conditions.Set(condition.FalseCondition(
@@ -925,7 +923,8 @@ func (r *CinderReconciler) generateServiceConfigs(
925923
string(dbSecret.Data[mariadbv1.DatabasePasswordSelector]),
926924
instance.Status.DatabaseHostname,
927925
cinder.DatabaseName)
928-
templateParameters["MemcachedServersWithInet"] = strings.Join(memcached.Status.ServerListWithInet, ",")
926+
templateParameters["MemcachedServersWithInet"] = memcached.GetMemcachedServerListWithInetString()
927+
templateParameters["MemcachedTLS"] = memcached.GetMemcachedTLSSupport()
929928

930929
// create httpd vhost template parameters
931930
httpdVhostConfig := map[string]interface{}{}
@@ -1012,26 +1011,6 @@ func (r *CinderReconciler) transportURLCreateOrUpdate(
10121011
return transportURL, op, err
10131012
}
10141013

1015-
// getCinderMemcached - gets the Memcached instance used for Cinder cache backend
1016-
func (r *CinderReconciler) getCinderMemcached(
1017-
ctx context.Context,
1018-
h *helper.Helper,
1019-
instance *cinderv1beta1.Cinder,
1020-
) (*memcachedv1.Memcached, error) {
1021-
memcached := &memcachedv1.Memcached{}
1022-
err := h.GetClient().Get(
1023-
ctx,
1024-
types.NamespacedName{
1025-
Name: instance.Spec.MemcachedInstance,
1026-
Namespace: instance.Namespace,
1027-
},
1028-
memcached)
1029-
if err != nil {
1030-
return nil, err
1031-
}
1032-
return memcached, err
1033-
}
1034-
10351014
func (r *CinderReconciler) apiDeploymentCreateOrUpdate(ctx context.Context, instance *cinderv1beta1.Cinder) (*cinderv1beta1.CinderAPI, controllerutil.OperationResult, error) {
10361015
cinderAPISpec := cinderv1beta1.CinderAPISpec{
10371016
CinderTemplate: instance.Spec.CinderTemplate,

go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,5 @@ replace github.com/openshift/api => github.com/openshift/api v0.0.0-202304141430
9494
// needed to to cert-manager v1.11.4 see https://github.com/cert-manager/cert-manager/blob/v1.11.4/go.mod#L263C1-L264C104
9595
// remove this once we bump to cert-manager v1.12.x
9696
replace github.com/Venafi/vcert/v4 => github.com/jetstack/vcert/v4 v4.9.6-0.20230519122548-219f317ae107 //allow-merging
97+
98+
replace github.com/openstack-k8s-operators/infra-operator/apis => github.com/stuggi/infra-operator/apis v0.0.0-20240307080001-2c64377dc93a

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ github.com/onsi/gomega v1.31.1 h1:KYppCUK+bUgAZwHOu7EXVBKyQA6ILvOESHkn/tgoqvo=
9191
github.com/onsi/gomega v1.31.1/go.mod h1:y40C95dwAD1Nz36SsEnxvfFe8FFfNxzI5eJ0EYGyAy0=
9292
github.com/openshift/api v0.0.0-20230414143018-3367bc7e6ac7 h1:rncLxJBpFGqBztyxCMwNRnMjhhIDOWHJowi6q8G6koI=
9393
github.com/openshift/api v0.0.0-20230414143018-3367bc7e6ac7/go.mod h1:ctXNyWanKEjGj8sss1KjjHQ3ENKFm33FFnS5BKaIPh4=
94-
github.com/openstack-k8s-operators/infra-operator/apis v0.3.1-0.20240219072823-a587b364203f h1:suf/08227pC+qQRbsUPLMOSw3mJ82b0o9Hs7MO/g9BY=
95-
github.com/openstack-k8s-operators/infra-operator/apis v0.3.1-0.20240219072823-a587b364203f/go.mod h1:FGKwlmAIgTsvvz2+uusWqNYFKHNAm4uzVyKao+emeu0=
9694
github.com/openstack-k8s-operators/keystone-operator/api v0.3.1-0.20240219094943-9bbb46c9afba h1:E/4DVkBwTxAgea7NRtkStoz66cUXZacZmEJlGcr5/0o=
9795
github.com/openstack-k8s-operators/keystone-operator/api v0.3.1-0.20240219094943-9bbb46c9afba/go.mod h1:YyoDWNxCFstwhVRAcEh2X6bXBG0ML5iEhOYQhltgqi4=
9896
github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20240216173409-86913e6d5885 h1:o7KZaxKt8Dr97ZJIBPW0P482gLyFEURKF89fizcJCBQ=
@@ -131,6 +129,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
131129
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
132130
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
133131
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
132+
github.com/stuggi/infra-operator/apis v0.0.0-20240307080001-2c64377dc93a h1:E4tn8kyOQz9EEQ3qi9G+dP5f6Wj8IRzqlKXtk3EUn5k=
133+
github.com/stuggi/infra-operator/apis v0.0.0-20240307080001-2c64377dc93a/go.mod h1:yPqJ+WU8jApuDXNUjpTxMafihuZpX3Yik9ZXqGaxYBQ=
134134
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
135135
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
136136
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=

0 commit comments

Comments
 (0)