Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion e2e/nvmeof-deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
apierrs "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/client-go/kubernetes"
"k8s.io/kubernetes/test/e2e/framework"
)

Expand Down Expand Up @@ -181,7 +182,7 @@ func createNVMeoFStorageClass(
Port int `json:"port"`
}{
{
Hostname: gwHost, // FIXME: is this required?
Hostname: gwHost, // short-hostname, without domain
Address: gwIP,
Port: 4420,
},
Expand Down Expand Up @@ -242,3 +243,31 @@ func createNVMeoFCredentials(f *framework.Framework) {
err = createRBDSecret(f, nvmeofNodePluginSecretName, nvmeofKeyringNodePluginUsername, key)
Expect(err).ShouldNot(HaveOccurred())
}

// getNVMeofGateway returns the service name and pod IP address of the NVMe-oF gateway
// in the rook-ceph namespace with label "app=rook-ceph-nvmeof".
func getNVMeofGateway(c kubernetes.Interface) (string, string) {
Comment thread
gadididi marked this conversation as resolved.
ctx := context.TODO()
labelSelector := "app=rook-ceph-nvmeof"

// Get the service
svcList, err := c.CoreV1().Services(rookNamespace).List(ctx, metav1.ListOptions{
LabelSelector: labelSelector,
})
Expect(err).ShouldNot(HaveOccurred())
Expect(svcList.Items).NotTo(BeEmpty(), "no service found with label %s in namespace %s", labelSelector, rookNamespace)

serviceName := svcList.Items[0].Name

// Get the pod
podList, err := c.CoreV1().Pods(rookNamespace).List(ctx, metav1.ListOptions{
LabelSelector: labelSelector,
})
Expect(err).ShouldNot(HaveOccurred())
Expect(podList.Items).NotTo(BeEmpty(), "no pod found with label %s in namespace %s", labelSelector, rookNamespace)

podIP := podList.Items[0].Status.PodIP
Expect(podIP).NotTo(BeEmpty(), "pod IP is empty for pod %s", podList.Items[0].Name)

return serviceName, podIP
}
125 changes: 0 additions & 125 deletions e2e/nvmeof-gateway.go

This file was deleted.

9 changes: 3 additions & 6 deletions e2e/nvmeof.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ import (
"k8s.io/pod-security-admission/api"
)

const (
nvmeofPool = "nvmeofpool"
var (
// FIXME: if this tests runs parallel with RBD, a dedicated pool is needed
nvmeofPool = defaultRBDPool
)

var _ = ginkgo.Describe("nvmeof", func() {
Expand Down Expand Up @@ -70,9 +71,6 @@ var _ = ginkgo.Describe("nvmeof", func() {

framework.Logf("NVMe-oF testing supported, Ceph version: %s", version)

// FIXME: gateway should get deployed by Rook
deployGateway(f, deployTimeout)

// No need to create the namespace if ceph-csi is deployed via helm or operator.
if cephCSINamespace != defaultNs && !(helmTest || operatorDeployment) {
err := createNamespace(f.ClientSet, cephCSINamespace)
Expand Down Expand Up @@ -123,7 +121,6 @@ var _ = ginkgo.Describe("nvmeof", func() {
}

deleteNVMeoFPlugin()
deleteGateway(f)
deleteNVMeofStorageClass(f, nvmeofStorageClass)
}, ginkgo.OncePerOrdered)

Expand Down
118 changes: 0 additions & 118 deletions e2e/nvmeof/config.yaml

This file was deleted.

Loading
Loading