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 authored and Cecile Robert-Michon committed Jun 14, 2022
1 parent 3b28324 commit 94d73a5
Show file tree
Hide file tree
Showing 9 changed files with 407 additions and 560 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 tool for more settings.

```bash
./hack/log/log-dump.sh
go run -tags e2e ./test/logger.go --name <workload-cluster-name> --namespace <workload-cluster-namespace>
```

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.

6 changes: 5 additions & 1 deletion scripts/ci-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,12 @@ on_exit() {
"${KUBECTL}" get nodes -owide || echo "Unable to get nodes"
"${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 94d73a5

Please sign in to comment.