Skip to content

Commit

Permalink
pwx-37596 | fix: add kubectl log command to follow log in case of fai…
Browse files Browse the repository at this point in the history
…lure (#1793)
  • Loading branch information
strivedi-px authored Jun 8, 2024
1 parent 1c8fb93 commit 819e7db
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
21 changes: 10 additions & 11 deletions test/integration_test/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM golang:1.17.0
FROM golang:1.21.10

# Install dependancies
RUN apt-get update && \
RUN apt-get update && \
/usr/local/go/bin/go install -v gotest.tools/gotestsum@latest

RUN apt-get update && apt-get install -y python3-pip && apt-get install -y jq

RUN pip3 install --upgrade pip
RUN apt-get update && \
apt-get install -y pipx jq && \
pipx ensurepath

#Install Google Cloud SDK
ARG GCLOUD_SDK=google-cloud-sdk-418.0.0-linux-x86_64.tar.gz
Expand All @@ -20,14 +20,13 @@ ENV PATH "${PATH}:$GCLOUD_INSTALL_DIR/google-cloud-sdk/bin"
RUN gcloud components install gke-gcloud-auth-plugin

RUN wget -O /usr/local/bin/aws-iam-authenticator https://amazon-eks.s3-us-west-2.amazonaws.com/1.10.3/2018-07-26/bin/linux/amd64/aws-iam-authenticator && \
chmod +x /usr/local/bin/aws-iam-authenticator

RUN pip3 install awscli
chmod +x /usr/local/bin/aws-iam-authenticator && \
pipx install awscli

# Install kubectl
RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
RUN chmod +x ./kubectl
RUN mv ./kubectl /usr/local/bin
RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && \
chmod +x ./kubectl && \
mv ./kubectl /usr/local/bin

WORKDIR /

Expand Down
4 changes: 3 additions & 1 deletion test/integration_test/migration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ func testMigration(t *testing.T) {
t.Run("excludeMultipleResourceTypesTest", excludeMultipleResourceTypesTest)
t.Run("excludeResourceTypesWithSelectorsTest", excludeResourceTypesWithSelectorsTest)
t.Run("excludeNonExistingResourceTypesTest", excludeNonExistingResourceTypesTest)
t.Run("transformCRResourceTest", transformCRResourceTest)
if authTokenConfigMap == "" {
t.Run("transformCRResourceTest", transformCRResourceTest)
}

err = setRemoteConfig("")
log.FailOnError(t, err, "setting kubeconfig to default failed")
Expand Down
4 changes: 3 additions & 1 deletion test/integration_test/test-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,9 @@ kubectl logs stork-test -n kube-system -f
for i in $(seq 1 100) ; do
test_status=$(kubectl get pod stork-test -n kube-system -o json | jq ".status.phase" -r)
if [ "$test_status" = "Running" ]; then
echo "Test is still running, status: $test_status"
sleep 5
echo "Test is still running, status: $test_status, resuming logs from past 10 seconds"
kubectl logs stork-test -n kube-system -f --since=10s
else
sleep 5
break
Expand Down

0 comments on commit 819e7db

Please sign in to comment.