forked from rook/rook
ceph: fixed DNS suffix breaks in custom DNS suffix clusters
By addding ".svc" to the endpoint of the object store, will fix the custom DNS suffix cluster. Signed-off-by: subhamkrai <subhamkumarrai03@gmail.com>
This commit is contained in:
@@ -100,5 +100,5 @@ func TestPopulateDomainAndPort(t *testing.T) {
|
||||
p.objectStoreName = store
|
||||
err = p.populateDomainAndPort(sc)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, "rook-ceph-rgw-test-store.ns.svc.cluster.local", p.storeDomainName)
|
||||
assert.Equal(t, "rook-ceph-rgw-test-store.ns.svc", p.storeDomainName)
|
||||
}
|
||||
|
||||
@@ -371,7 +371,7 @@ func TestCephObjectStoreController(t *testing.T) {
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, cephv1.ConditionProgressing, objectStore.Status.Phase, objectStore)
|
||||
assert.NotEmpty(t, objectStore.Status.Info["endpoint"], objectStore)
|
||||
assert.Equal(t, "http://rook-ceph-rgw-my-store.rook-ceph.svc.cluster.local:80", objectStore.Status.Info["endpoint"], objectStore)
|
||||
assert.Equal(t, "http://rook-ceph-rgw-my-store.rook-ceph.svc:80", objectStore.Status.Info["endpoint"], objectStore)
|
||||
logger.Info("PHASE 3 DONE")
|
||||
|
||||
// Test the functionality of verifyObjectUserCleanup
|
||||
|
||||
@@ -44,7 +44,7 @@ const (
|
||||
bucketProvisionerName = "ceph.rook.io/bucket"
|
||||
AccessKeyName = "access-key"
|
||||
SecretKeyName = "secret-key"
|
||||
svcDNSSuffix = "svc.cluster.local"
|
||||
svcDNSSuffix = "svc"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -159,15 +159,15 @@ func TestBuildDomainNameAndEndpoint(t *testing.T) {
|
||||
name := "my-store"
|
||||
ns := "rook-ceph"
|
||||
dns := BuildDomainName(name, ns)
|
||||
assert.Equal(t, "rook-ceph-rgw-my-store.rook-ceph.svc.cluster.local", dns)
|
||||
assert.Equal(t, "rook-ceph-rgw-my-store.rook-ceph.svc", dns)
|
||||
|
||||
// non-secure endpoint
|
||||
var port int32 = 80
|
||||
ep := buildDNSEndpoint(dns, port, false)
|
||||
assert.Equal(t, "http://rook-ceph-rgw-my-store.rook-ceph.svc.cluster.local:80", ep)
|
||||
assert.Equal(t, "http://rook-ceph-rgw-my-store.rook-ceph.svc:80", ep)
|
||||
|
||||
// Secure endpoint
|
||||
var securePort int32 = 443
|
||||
ep = buildDNSEndpoint(dns, securePort, true)
|
||||
assert.Equal(t, "https://rook-ceph-rgw-my-store.rook-ceph.svc.cluster.local:443", ep)
|
||||
assert.Equal(t, "https://rook-ceph-rgw-my-store.rook-ceph.svc:443", ep)
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ func TestBuildStatusInfo(t *testing.T) {
|
||||
statusInfo := buildStatusInfo(cephObjectStore)
|
||||
assert.NotEmpty(t, statusInfo["endpoint"])
|
||||
assert.Empty(t, statusInfo["secureEndpoint"])
|
||||
assert.Equal(t, "http://rook-ceph-rgw-my-store.rook-ceph.svc.cluster.local:80", statusInfo["endpoint"])
|
||||
assert.Equal(t, "http://rook-ceph-rgw-my-store.rook-ceph.svc:80", statusInfo["endpoint"])
|
||||
|
||||
// SecurePort enabled and Port disabled
|
||||
cephObjectStore.Spec.Gateway.Port = 0
|
||||
@@ -46,7 +46,7 @@ func TestBuildStatusInfo(t *testing.T) {
|
||||
statusInfo = buildStatusInfo(cephObjectStore)
|
||||
assert.NotEmpty(t, statusInfo["endpoint"])
|
||||
assert.Empty(t, statusInfo["secureEndpoint"])
|
||||
assert.Equal(t, "https://rook-ceph-rgw-my-store.rook-ceph.svc.cluster.local:443", statusInfo["endpoint"])
|
||||
assert.Equal(t, "https://rook-ceph-rgw-my-store.rook-ceph.svc:443", statusInfo["endpoint"])
|
||||
|
||||
// Both Port and SecurePort enabled
|
||||
cephObjectStore.Spec.Gateway.Port = 80
|
||||
@@ -55,6 +55,6 @@ func TestBuildStatusInfo(t *testing.T) {
|
||||
statusInfo = buildStatusInfo(cephObjectStore)
|
||||
assert.NotEmpty(t, statusInfo["endpoint"])
|
||||
assert.NotEmpty(t, statusInfo["secureEndpoint"])
|
||||
assert.Equal(t, "http://rook-ceph-rgw-my-store.rook-ceph.svc.cluster.local:80", statusInfo["endpoint"])
|
||||
assert.Equal(t, "https://rook-ceph-rgw-my-store.rook-ceph.svc.cluster.local:443", statusInfo["secureEndpoint"])
|
||||
assert.Equal(t, "http://rook-ceph-rgw-my-store.rook-ceph.svc:80", statusInfo["endpoint"])
|
||||
assert.Equal(t, "https://rook-ceph-rgw-my-store.rook-ceph.svc:443", statusInfo["secureEndpoint"])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user