Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consolidate e2e log collection #2345

Merged
merged 1 commit into from
Jun 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

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