Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Sébastien Han <seb@redhat.com>
  • Loading branch information
leseb committed Nov 5, 2021
1 parent 430e495 commit 6835ee5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/integration-test-smoke-suite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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
15 changes: 9 additions & 6 deletions pkg/operator/ceph/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"fmt"
"io/ioutil"
"os"
"path"

"github.com/pkg/errors"
"github.com/rook/rook/pkg/clusterd"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6835ee5

Please sign in to comment.