Skip to content

Commit

Permalink
fix2
Browse files Browse the repository at this point in the history
  • Loading branch information
sauterp committed Mar 18, 2024
1 parent 6bfe504 commit 98c55ae
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
3 changes: 3 additions & 0 deletions internal/integ/cluster/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,5 +169,8 @@ func Setup() error {
}
}

testCluster.printDeploymentLogs(ctx, csiControllerName)
testCluster.printDaemonSetLogs(ctx, csiNodeDriverName)

return nil
}
23 changes: 8 additions & 15 deletions internal/integ/cluster/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"fmt"
"io"
"log/slog"
"os"
"strings"
"time"

Expand All @@ -24,6 +23,9 @@ import (
const (
apiKeyPrefix = "csi-integ-test-key-"
csiNamespace = "kube-system"

csiControllerName = "exoscale-csi-controller"
csiNodeDriverName = "exoscale-csi-node"
)

var (
Expand Down Expand Up @@ -206,16 +208,12 @@ func (c *Cluster) applyCSI(ctx context.Context) error {
// the CSI controller needs to restart, in case it is already running, to pick up the new secrets
c.restartCSIController(ctx)

controllerName := "exoscale-csi-controller"
c.printDeploymentLogs(ctx, controllerName)
if err := c.awaitDeploymentReadiness(ctx, controllerName); err != nil {
slog.Warn("error while awaiting", "deployment", controllerName, "error", err)
if err := c.awaitDeploymentReadiness(ctx, csiControllerName); err != nil {
slog.Warn("error while awaiting", "deployment", csiControllerName, "error", err)
}

nodeDriverName := "exoscale-csi-node"
c.printDaemonSetLogs(ctx, nodeDriverName)
if err := c.awaitDaemonSetReadiness(ctx, nodeDriverName); err != nil {
slog.Warn("error while awaiting", "DaemonSet", nodeDriverName, "error", err)
if err := c.awaitDaemonSetReadiness(ctx, csiNodeDriverName); err != nil {
slog.Warn("error while awaiting", "DaemonSet", csiNodeDriverName, "error", err)
}

return nil
Expand Down Expand Up @@ -301,12 +299,7 @@ func printLogs(podName string, logStream io.ReadCloser) {
return
}

_, err = os.Stdout.WriteString(line)
if err != nil {
slog.Warn("failed to write log line to stdout", "pod", podName, "err", err)

return
}
fmt.Print(line)
}
}

Expand Down

0 comments on commit 98c55ae

Please sign in to comment.