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 8, 2022
1 parent efc37fd commit 08626ea
Show file tree
Hide file tree
Showing 9 changed files with 406 additions and 559 deletions.
8 changes: 5 additions & 3 deletions docs/book/src/topics/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,12 @@ 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) <!-- markdown-link-check-disable-line -->
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 --name 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 @@ -153,8 +153,11 @@ on_exit() {
"${KUBECTL}" get pods -A -owide || echo "Unable to get pods"
fi

# 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 --name "${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 08626ea

Please sign in to comment.