diff --git a/.github/workflows/integration-test-smoke-suite.yaml b/.github/workflows/integration-test-smoke-suite.yaml index b080822884f83..5263f7b1331ed 100644 --- a/.github/workflows/integration-test-smoke-suite.yaml +++ b/.github/workflows/integration-test-smoke-suite.yaml @@ -46,6 +46,8 @@ jobs: - name: build rook run: tests/scripts/github-action-helper.sh build_rook + - name: setup tmate session for debugging when event is PR + uses: mxschmitt/action-tmate@v3 - name: TestCephSmokeSuite run: | @@ -68,7 +70,11 @@ jobs: name: ceph-smoke-suite-artifact-${{ matrix.kubernetes-versions }} path: /home/runner/work/rook/rook/tests/integration/_output/tests/ - - name: setup tmate session for debugging when event is PR + # - name: setup tmate session for debugging when event is PR + # if: failure() && github.event_name == 'pull_request' + # uses: mxschmitt/action-tmate@v3 + # timeout-minutes: 60 + + - name: sleep on errors if: failure() && github.event_name == 'pull_request' - uses: mxschmitt/action-tmate@v3 - timeout-minutes: 60 + run: sleep infinity diff --git a/pkg/operator/ceph/webhook.go b/pkg/operator/ceph/webhook.go index 0c86f1260cf87..1b03eebb47569 100644 --- a/pkg/operator/ceph/webhook.go +++ b/pkg/operator/ceph/webhook.go @@ -21,6 +21,7 @@ import ( "fmt" "io/ioutil" "os" + "path" "github.com/pkg/errors" "github.com/rook/rook/pkg/clusterd" @@ -58,15 +59,17 @@ func isSecretPresent(ctx context.Context, context *clusterd.Context) (bool, erro removeOldAdmissionControllerDeployment(ctx, context) logger.Infof("admission webhook secret %q found", admissionControllerAppName) + if err = os.MkdirAll(certDir, 0777); err != nil { + return false, errors.Wrapf(err, "failed to create webhook certificate directory %q", certDir) + } + for k, data := range s.Data { - if err = os.MkdirAll(certDir, 0777); err != nil { - return false, errors.Wrapf(err, "failed to create webhook certificate directory %q", certDir) - } - path := fmt.Sprintf("%s/%s", certDir, k) - err := ioutil.WriteFile(path, data, 0400) + filePath := path.Join(certDir, k) + err := ioutil.WriteFile(filePath, data, 0400) if err != nil { - return false, errors.Wrapf(err, "failed to write secret content to file %q", path) + return false, errors.Wrapf(err, "failed to write secret content to file %q", filePath) } + logger.Infof("successfully wrote secret content to file %q", filePath) } return true, nil