Skip to content

Commit 48457f1

Browse files
authored
Merge pull request #503 from Madhu-1/pod-info
controller: set podInfoOnMount to true
2 parents c9f30bd + 7e72292 commit 48457f1

2 files changed

Lines changed: 27 additions & 1 deletion

File tree

.github/workflows/test-charts.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,29 @@ jobs:
7272
./kubernetes/test/bin/e2e.test \
7373
-- \
7474
-storage.testdriver="$(pwd)/test/scripts/k8s-storage/driver-${{ matrix.driver }}.yaml"
75+
76+
- name: Collect logs on failure
77+
if: failure()
78+
run: |
79+
LOG_DIR="${GITHUB_WORKSPACE}/logs-${{ matrix.driver }}"
80+
mkdir -p "${LOG_DIR}"
81+
82+
kubectl get pods --all-namespaces -o wide > "${LOG_DIR}/all-pods.txt" 2>&1 || true
83+
kubectl get events --all-namespaces --sort-by='.lastTimestamp' > "${LOG_DIR}/all-events.txt" 2>&1 || true
84+
kubectl describe pods --all-namespaces > "${LOG_DIR}/all-pods-describe.txt" 2>&1 || true
85+
86+
for ns in $(kubectl get namespaces -o jsonpath='{.items[*].metadata.name}'); do
87+
for pod in $(kubectl get pods -n "${ns}" -o jsonpath='{.items[*].metadata.name}'); do
88+
for container in $(kubectl get pod "${pod}" -n "${ns}" -o jsonpath='{.spec.containers[*].name}'); do
89+
kubectl logs "${pod}" -n "${ns}" -c "${container}" --tail=500 \
90+
> "${LOG_DIR}/${ns}_${pod}_${container}.log" 2>&1 || true
91+
done
92+
done
93+
done
94+
95+
- name: Upload logs on failure
96+
if: failure()
97+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
98+
with:
99+
name: e2e-logs-${{ matrix.driver }}
100+
path: logs-${{ matrix.driver }}

internal/controller/driver_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ func (r *driverReconcile) reconcileK8sCsiDriver() error {
476476
return err
477477
}
478478

479-
csiDriver.Spec.PodInfoOnMount = ptr.To(false)
479+
csiDriver.Spec.PodInfoOnMount = ptr.To(true)
480480
csiDriver.Spec.AttachRequired = cmp.Or(
481481
r.driver.Spec.AttachRequired,
482482
ptr.To(true),

0 commit comments

Comments
 (0)