Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
cupnes committed Mar 13, 2024
1 parent bc9e7e6 commit 34a6653
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 20 deletions.
14 changes: 14 additions & 0 deletions e2e/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,20 @@ launch-rook-ceph: create-loop-dev
echo "failed to start rook operator" > /dev/stderr; \
exit 1; \
fi
is_ok="false"; \
for i in $(shell seq $(TIMEOUT)); do \
available_replicas=$$($(KUBECTL) -n $(NS) get deploy rook-ceph-osd-0 -o json | jq -r ".status.availableReplicas"); \
if [ $$available_replicas -eq 1 ]; then \
is_ok="true"; \
break; \
fi; \
echo "osd.0 is not available yet" > /dev/stderr; \
sleep $(POLLING_INTERVAL); \
done; \
if [ "$$is_ok" = "false" ]; then \
echo "failed to start osd.0" > /dev/stderr; \
exit 1; \
fi

.PHONY: delete-rook-ceph
delete-rook-ceph:
Expand Down
20 changes: 0 additions & 20 deletions e2e/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,26 +78,6 @@ func TestMtest(t *testing.T) {
}

var _ = BeforeSuite(func() {
By("[BeforeSuite] Waiting for ceph cluster to get ready")
Eventually(func() error {
stdout, stderr, err := kubectl("-n", namespace, "get", "deploy", "rook-ceph-osd-0", "-o", "json")
if err != nil {
return fmt.Errorf("kubectl get deploy failed. stderr: %s, err: %w", string(stderr), err)
}

var deploy appsv1.Deployment
err = yaml.Unmarshal(stdout, &deploy)
if err != nil {
return err
}

if deploy.Status.AvailableReplicas != 1 {
return fmt.Errorf("osd.0 is not available yet")
}

return nil
}).Should(Succeed())

By("[BeforeSuite] Creating RBD Pool and SC")
Eventually(func() error {
manifest := fmt.Sprintf(testRBDPoolSCTemplate, poolName, namespace, poolName, namespace, namespace, namespace)
Expand Down

0 comments on commit 34a6653

Please sign in to comment.