Skip to content

Commit 17e1313

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

File tree

3 files changed

+8
-27
lines changed

3 files changed

+8
-27
lines changed

controllers/neutronapi_controller.go

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package controllers
1919
import (
2020
"context"
2121
"fmt"
22-
"strings"
2322
"time"
2423

2524
"github.com/go-logr/logr"
@@ -831,7 +830,7 @@ func (r *NeutronAPIReconciler) reconcileNormal(ctx context.Context, instance *ne
831830
instance.Status.Conditions.MarkTrue(condition.InputReadyCondition, condition.InputReadyMessage)
832831
// run check OpenStack secret - end
833832

834-
memcached, err := r.getNeutronMemcached(ctx, helper, instance)
833+
memcached, err := memcachedv1.GetMemcachedByName(ctx, helper, instance.Spec.MemcachedInstance, instance.Namespace)
835834
if err != nil {
836835
if k8s_errors.IsNotFound(err) {
837836
instance.Status.Conditions.Set(condition.FalseCondition(
@@ -1409,7 +1408,7 @@ func (r *NeutronAPIReconciler) generateServiceSecrets(
14091408
return err
14101409
}
14111410

1412-
mc, err := r.getNeutronMemcached(ctx, h, instance)
1411+
mc, err := memcachedv1.GetMemcachedByName(ctx, h, instance.Spec.MemcachedInstance, instance.Namespace)
14131412
if err != nil {
14141413
return err
14151414
}
@@ -1419,8 +1418,8 @@ func (r *NeutronAPIReconciler) generateServiceSecrets(
14191418
templateParameters["KeystoneInternalURL"] = keystoneInternalURL
14201419
templateParameters["KeystonePublicURL"] = keystonePublicURL
14211420
templateParameters["TransportURL"] = transportURL
1422-
templateParameters["MemcachedServers"] = strings.Join(mc.Status.ServerList, ",")
1423-
templateParameters["MemcachedServersWithInet"] = strings.Join(mc.Status.ServerListWithInet, ",")
1421+
templateParameters["MemcachedServers"] = mc.GetMemcachedServerListString()
1422+
templateParameters["MemcachedServersWithInet"] = mc.GetMemcachedServerListWithInetString()
14241423

14251424
// Other OpenStack services
14261425
servicePassword := string(ospSecret.Data[instance.Spec.PasswordSelectors.Service])
@@ -1538,26 +1537,6 @@ func (r *NeutronAPIReconciler) memcachedNamespaceMapFunc(ctx context.Context, cl
15381537
}
15391538
}
15401539

1541-
// getNeutronMemcached - gets the Memcached instance used for neutron cache backend
1542-
func (r *NeutronAPIReconciler) getNeutronMemcached(
1543-
ctx context.Context,
1544-
h *helper.Helper,
1545-
instance *neutronv1beta1.NeutronAPI,
1546-
) (*memcachedv1.Memcached, error) {
1547-
memcached := &memcachedv1.Memcached{}
1548-
err := h.GetClient().Get(
1549-
ctx,
1550-
types.NamespacedName{
1551-
Name: instance.Spec.MemcachedInstance,
1552-
Namespace: instance.Namespace,
1553-
},
1554-
memcached)
1555-
if err != nil {
1556-
return nil, err
1557-
}
1558-
return memcached, err
1559-
}
1560-
15611540
// ensureDB - create neutron DB instance
15621541
func (r *NeutronAPIReconciler) ensureDB(
15631542
ctx context.Context,

go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,5 @@ replace github.com/openstack-k8s-operators/neutron-operator/api => ./api
9090
// mschuppert: map to latest commit from release-4.13 tag
9191
// must consistent within modules and service operators
9292
replace github.com/openshift/api => github.com/openshift/api v0.0.0-20230414143018-3367bc7e6ac7 //allow-merging
93+
94+
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.20240221083751-49edc0df8a12 h1:n+A0L+6w3Yt9iOVWdu0aU8Ig0fICv4luruVjH5kU7KM=
95-
github.com/openstack-k8s-operators/infra-operator/apis v0.3.1-0.20240221083751-49edc0df8a12/go.mod h1:2//rIZ8ucDbK+gLxvwmU6uPCm6o/C6GxXJHDo4ye7I8=
9694
github.com/openstack-k8s-operators/keystone-operator/api v0.3.1-0.20240226160457-b1b853eb4600 h1:Lqlkv5CWGlarcjsc1SW2YzhxAVQtQZp0BWEwFUl+OyM=
9795
github.com/openstack-k8s-operators/keystone-operator/api v0.3.1-0.20240226160457-b1b853eb4600/go.mod h1:YyoDWNxCFstwhVRAcEh2X6bXBG0ML5iEhOYQhltgqi4=
9896
github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20240229121803-169ced56d56e h1:zpxxz/iI8C09XHBcDYW9prMoODndBBsSmoonRXRXu1Q=
@@ -133,6 +131,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
133131
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
134132
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
135133
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
134+
github.com/stuggi/infra-operator/apis v0.0.0-20240307080001-2c64377dc93a h1:E4tn8kyOQz9EEQ3qi9G+dP5f6Wj8IRzqlKXtk3EUn5k=
135+
github.com/stuggi/infra-operator/apis v0.0.0-20240307080001-2c64377dc93a/go.mod h1:yPqJ+WU8jApuDXNUjpTxMafihuZpX3Yik9ZXqGaxYBQ=
136136
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
137137
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
138138
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=

0 commit comments

Comments
 (0)