Skip to content
This repository was archived by the owner on Dec 12, 2025. It is now read-only.

Commit fbf27f9

Browse files
authored
[dev] [ux] dump additional logs and dev env configurations (#1184)
* [dev] [ux] add additional logs, ignore generated files update dev env * update doc how to run e2e telepresence
1 parent 317dd76 commit fbf27f9

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,8 @@ manifests: controller-gen ## Generate manifests e.g. CRD, RBAC etc.
116116

117117
# Run e2e tests locally using go build while also setting up a proxy in the shell to allow
118118
# the test to run as if it were inside the cluster. This enables mongodb connectivity while running locally.
119-
e2e-telepresence: cleanup-e2e install ## Run e2e tests locally using go build while also setting up a proxy
119+
e2e-telepresence: cleanup-e2e install ## Run e2e tests locally using go build while also setting up a proxy e.g. make e2e-telepresence test=replica_set cleanup=true
120120
telepresence connect; \
121-
telepresence status; \
122121
eval $$(scripts/dev/get_e2e_env_vars.py $(cleanup)); \
123122
go test -v -timeout=30m -failfast ./test/e2e/$(test); \
124123
telepresence quit
@@ -133,7 +132,7 @@ e2e: cleanup-e2e install ## Run e2e test locally. e.g. make e2e test=replica_set
133132
e2e-gh: ## Trigger a Github Action of the given test
134133
scripts/dev/run_e2e_gh.sh $(test)
135134

136-
cleanup-e2e:
135+
cleanup-e2e: ## Cleans up e2e test env
137136
kubectl delete mdbc,all,secrets -l e2e-test=true -n ${TEST_NAMESPACE} || true
138137
# Most of the tests use StatefulSets, which in turn use stable storage. In order to
139138
# avoid interleaving tests with each other, we need to drop them all.

scripts/ci/dump_diagnostics.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ namespace="$1"
77
echo "Dumping CRD"
88
kubectl get crd mongodbcommunity.mongodbcommunity.mongodb.com -o yaml > diagnostics/crd.yaml
99

10+
echo "Dumping Pod list"
11+
kubectl get pods > diagnostics/pod-list.txt
12+
1013
# dump operator deployment information.
1114
for deployment_name in $(kubectl get deployment -n "${namespace}" --output=jsonpath={.items..metadata.name}); do
1215
echo "Writing Deployment describe for deployment ${deployment_name}"
@@ -24,6 +27,9 @@ for pod_name in $(kubectl get pod -n "${namespace}" --output=jsonpath={.items..m
2427
echo "Writing Pod yaml for pod ${pod_name}"
2528
kubectl get pod "${pod_name}" -o yaml > "diagnostics/${pod_name}.yaml"
2629

30+
# dump agent output
31+
kubectl cp "${pod_name}":/var/log/mongodb-mms-automation -c mongodb-agent diagnostics/"${pod_name}-mongodb-automation"/
32+
2733
for container_name in $(kubectl get pods -n "${namespace}" "${pod_name}" -o jsonpath='{.spec.containers[*].name}'); do
2834
echo "Writing log file for pod ${pod_name} - container ${container_name} to diagnostics/${pod_name}-${container_name}.log"
2935
kubectl logs -n "${namespace}" "${pod_name}" -c "${container_name}" > "diagnostics/${pod_name}-${container_name}.log";
@@ -45,7 +51,6 @@ for mdbc_name in $(kubectl get mongodbcommunity -n "${namespace}" --output=jsonp
4551
kubectl get secret "${mdbc_name}-config" -o jsonpath='{ .data.cluster-config\.json}' | base64 -d | jq > "diagnostics/secrets/${mdbc_name}-config.json"
4652
done
4753

48-
4954
# dump information about relevant secrets.
5055
# Skip service account tokens, and also skip the Automation Config as this is handled as a special case above.
5156
for secret in $(kubectl get secret -n "${namespace}" --output=jsonpath={.items..metadata.name}); do
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
#!/usr/bin/env bash
22

33
if ! command -v telepresence &> /dev/null; then \
4-
echo "Telepresence not found, installing now"
5-
sudo curl -fL https://app.getambassador.io/download/tel2/darwin/amd64/latest/telepresence -o /usr/local/bin/telepresence
6-
sudo chmod a+x /usr/local/bin/telepresence
4+
echo "Telepresence not found, installing now"
5+
sudo curl -fL https://app.getambassador.io/download/tel2/"$(go env GOHOSTOS)"/"$(go env GOHOSTARCH)"/latest/telepresence -o /tmp/telepresence
6+
sudo mv /tmp/telepresence /usr/local/bin/telepresence
7+
sudo chmod a+x /usr/local/bin/telepresence
78
else
89
echo "Telepresence already installed."
910
fi

0 commit comments

Comments
 (0)