Skip to content

Commit

Permalink
refactor logging so it is same in all scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
jsturtevant committed Jun 3, 2022
1 parent 46671a5 commit becff43
Show file tree
Hide file tree
Showing 8 changed files with 387 additions and 559 deletions.
7 changes: 4 additions & 3 deletions docs/book/src/topics/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,11 @@ ssh -J capi@${apiserver} capi@${node}

## Automated log collection

As part of [CI](../../../../scripts/ci-e2e.sh) there is a [log collection script](../../../../hack/log/log-dump.sh) which you can also leverage to pull all the logs for machines which will dump logs to `${PWD}/_artifacts}` by default:
As part of CI there is a [log collection tool](https://github.com/kubernetes-sigs/cluster-api-provider-azure/tree/main/test/logger.go) which you can also leverage to pull all the logs for machines which will dump logs to `${PWD}/_artifacts}` by default.
The following works if your kubeconfig is configured with the management cluster. See the the tool for more settings.

```bash
./hack/log/log-dump.sh
go run -tags e2e ./test/logger.go --clustername capz-conf-j1t0qh --namespace default
```

There are also some [provided scripts](../../../../hack/debugging/Readme.md) that can help automate a few common tasks.
There are also some [provided scripts](https://github.com/kubernetes-sigs/cluster-api-provider-azure/tree/main/hack/debugging) that can help automate a few common tasks.
36 changes: 0 additions & 36 deletions hack/log/log-dump-daemonset-windows.yaml

This file was deleted.

48 changes: 0 additions & 48 deletions hack/log/log-dump-daemonset.yaml

This file was deleted.

235 changes: 0 additions & 235 deletions hack/log/log-dump.sh

This file was deleted.

5 changes: 4 additions & 1 deletion scripts/ci-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,11 @@ cleanup() {
}

on_exit() {
# unset kubeconfig which is currently pointing at workload cluster.
# we want to be pointing at the management cluster (kind in this case)
unset KUBECONFIG
"${REPO_ROOT}/hack/log/log-dump.sh" || true
go run -tags e2e "${REPO_ROOT}"/test/logger.go --clustername "${CLUSTER_NAME}" --namespace default
"${REPO_ROOT}/hack/log/redact.sh" || true
# cleanup
if [[ -z "${SKIP_CLEANUP:-}" ]]; then
cleanup
Expand Down
Loading

0 comments on commit becff43

Please sign in to comment.