Skip to content

Commit 68c7255

Browse files
committed
[testhelper] update serverList and serverListWithInet for fqdn
For tls, in openstack-k8s-operators#192 changed the server lists to contain the svc fqdn, but missed to update the test helpers.
1 parent 8b35d05 commit 68c7255

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

apis/memcached/v1beta1/memcached_funcs.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,24 @@ func (instance *Memcached) GetMemcachedServerListString() string {
6262
return strings.Join(instance.Status.ServerList, ",")
6363
}
6464

65+
// GetMemcachedServerListQuotedString - return the memcached servers, each quoted, as comma separated list
66+
// to be used in OpenStack config.
67+
func (instance *Memcached) GetMemcachedServerListQuotedString() string {
68+
return strings.Join(instance.Status.ServerList, "','")
69+
}
70+
6571
// GetMemcachedServerListWithInetString - return the memcached servers as comma separated list
6672
// to be used in OpenStack config.
6773
func (instance *Memcached) GetMemcachedServerListWithInetString() string {
6874
return strings.Join(instance.Status.ServerListWithInet, ",")
6975
}
7076

77+
// GetMemcachedServerListWithInetQuotedString - return the memcached servers, each quoted, as comma separated list
78+
// to be used in OpenStack config.
79+
func (instance *Memcached) GetMemcachedServerListWithInetQuotedString() string {
80+
return strings.Join(instance.Status.ServerListWithInet, ",")
81+
}
82+
7183
// GetMemcachedTLSSupport - return the TLS support of the memcached instance
7284
func (instance *Memcached) GetMemcachedTLSSupport() bool {
7385
return instance.Status.TLSSupport

apis/test/helpers/memcached.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ func (tc *TestHelper) SimulateMemcachedReady(name types.NamespacedName) {
112112
serverList := []string{}
113113
serverListWithInet := []string{}
114114
for i := 0; i < int(*mc.Spec.Replicas); i++ {
115-
serverList = append(serverList, fmt.Sprintf("%s-%d.%s:11211", mc.Name, i, mc.Name))
116-
serverListWithInet = append(serverListWithInet, fmt.Sprintf("inet:[%s-%d.%s]:11211", mc.Name, i, mc.Name))
115+
serverList = append(serverList, fmt.Sprintf("%s-%d.%s.%s.svc:11211", mc.Name, i, mc.Name, mc.Namespace))
116+
serverListWithInet = append(serverListWithInet, fmt.Sprintf("inet:[%s-%d.%s.%s.svc]:11211", mc.Name, i, mc.Name, mc.Namespace))
117117
}
118118
mc.Status.ServerList = serverList
119119
mc.Status.ServerListWithInet = serverListWithInet

0 commit comments

Comments
 (0)