Skip to content

Commit

Permalink
Merge pull request #339 from jacobwolfaws/master
Browse files Browse the repository at this point in the history
Remove ebs references from e2e testing
  • Loading branch information
k8s-ci-robot authored Jul 13, 2023
2 parents e53300d + 11a8b39 commit 6c2d1f3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 144 deletions.
35 changes: 2 additions & 33 deletions hack/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,44 +13,13 @@ For more details, see the script itself.
For more examples, see the top-level Makefile.

```
TEST_PATH=./tests/e2e-migration/... \
EBS_CHECK_MIGRATION=true \
TEST_PATH=./tests/e2e/... \
TEST_ID=18512 \
CLEAN=false \
KOPS_STATE_FILE=s3://mattwon \
AWS_REGION=us-west-2 \
AWS_AVAILABILITY_ZONES=us-west-2a \
GINKGO_FOCUS=Dynamic.\*xfs.\*should.store.data \
GINKGO_FOCUS=".*" \
GINKGO_NODES=1 \
./hack/e2e/run.sh
```

# git read-tree

Reference: https://stackoverflow.com/questions/23937436/add-subdirectory-of-remote-repo-with-git-subtree

How to consume this directory by read-treeing the ebs repo:

```
git remote add ebs [email protected]:kubernetes-sigs/aws-ebs-csi-driver.git
git fetch ebs
git read-tree --prefix=hack/e2e/ -u ebs/master:hack/e2e
```

To commit changes and submit them as a PR back to the ebs repo:

```
git diff ebs/master:hack/e2e HEAD:hack/e2e > /tmp/hack_e2e.diff
pushd $GOPATH/src/github.com/kubernetes-sigs/aws-ebs-csi-driver
git apply --reject --directory hack/e2e /tmp/hack_e2e.diff
git commit
```

To consume newer changes from the ebs repo:

```
git fetch ebs
git diff HEAD:hack/e2e ebs/master:hack/e2e > /tmp/hack_e2e.diff
git apply --reject --directory hack/e2e /tmp/hack_e2e.diff
git commit
```
63 changes: 0 additions & 63 deletions hack/e2e/ebs.sh

This file was deleted.

14 changes: 0 additions & 14 deletions hack/e2e/eksctl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ function eksctl_create_cluster() {
KUBECONFIG=${8}
EKSCTL_PATCH_FILE=${9}
EKSCTL_ADMIN_ROLE=${10}
WINDOWS=${11}

generate_ssh_key "${SSH_KEY_PATH}"

Expand Down Expand Up @@ -66,19 +65,6 @@ function eksctl_create_cluster() {
${BIN} create iamidentitymapping --cluster "${CLUSTER_NAME}" --arn "${ADMIN_ARN}" --group system:masters --username admin
fi

if [[ "$WINDOWS" == true ]]; then
${BIN} create nodegroup \
--managed=false \
--cluster="${CLUSTER_NAME}" \
--node-ami-family=WindowsServer2019FullContainer \
-n ng-windows \
-m 1 \
-M 1 \
--ssh-access \
--ssh-public-key "${SSH_KEY_PATH}".pub
${BIN} utils install-vpc-controllers --cluster="${CLUSTER_NAME}" --approve
fi

return $?
}

Expand Down
38 changes: 4 additions & 34 deletions hack/e2e/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@
set -euo pipefail

BASE_DIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")")
source "${BASE_DIR}"/ebs.sh
source "${BASE_DIR}"/ecr.sh
source "${BASE_DIR}"/eksctl.sh
source "${BASE_DIR}"/helm.sh
source "${BASE_DIR}"/kops.sh
source "${BASE_DIR}"/util.sh

DRIVER_NAME=${DRIVER_NAME:-aws-ebs-csi-driver}
CONTAINER_NAME=${CONTAINER_NAME:-ebs-plugin}
DRIVER_NAME=${DRIVER_NAME:-aws-fsx-csi-driver}
CONTAINER_NAME=${CONTAINER_NAME:-fsx-plugin}
DRIVER_START_TIME_THRESHOLD_SECONDS=60

TEST_ID=${TEST_ID:-$RANDOM}
Expand Down Expand Up @@ -60,23 +59,17 @@ KOPS_PATCH_NODE_FILE=${KOPS_PATCH_NODE_FILE:-./hack/kops-patch-node.yaml}
EKSCTL_VERSION=${EKSCTL_VERSION:-0.69.0}
EKSCTL_PATCH_FILE=${EKSCTL_PATCH_FILE:-./hack/eksctl-patch.yaml}
EKSCTL_ADMIN_ROLE=${EKSCTL_ADMIN_ROLE:-}
# Creates a windows node group. The windows ami doesn't (yet) install csi-proxy
# so that has to be done separately.
WINDOWS=${WINDOWS:-"false"}

HELM_VALUES_FILE=${HELM_VALUES_FILE:-./hack/values.yaml}
HELM_EXTRA_FLAGS=${HELM_EXTRA_FLAGS:-}

TEST_PATH=${TEST_PATH:-"./tests/e2e"}
ARTIFACTS=${ARTIFACTS:-"${TEST_DIR}/artifacts"}
GINKGO_FOCUS=${GINKGO_FOCUS:-"\[ebs-csi-e2e\]"}
GINKGO_FOCUS=${GINKGO_FOCUS:-"\[fsx-csi-e2e\]"}
GINKGO_SKIP=${GINKGO_SKIP:-"\[Disruptive\]"}
GINKGO_NODES=${GINKGO_NODES:-4}
TEST_EXTRA_FLAGS=${TEST_EXTRA_FLAGS:-}

EBS_INSTALL_SNAPSHOT=${EBS_INSTALL_SNAPSHOT:-"false"}
EBS_INSTALL_SNAPSHOT_VERSION=${EBS_INSTALL_SNAPSHOT_VERSION:-"v4.1.1"}
EBS_CHECK_MIGRATION=${EBS_CHECK_MIGRATION:-"false"}

CLEAN=${CLEAN:-"true"}

Expand Down Expand Up @@ -142,22 +135,12 @@ elif [[ "${CLUSTER_TYPE}" == "eksctl" ]]; then
"$CLUSTER_FILE" \
"$KUBECONFIG" \
"$EKSCTL_PATCH_FILE" \
"$EKSCTL_ADMIN_ROLE" \
"$WINDOWS"
"$EKSCTL_ADMIN_ROLE"
if [[ $? -ne 0 ]]; then
exit 1
fi
fi

if [[ "${EBS_INSTALL_SNAPSHOT}" == true ]]; then
loudecho "Installing snapshot controller and CRDs"
kubectl apply --kubeconfig "${KUBECONFIG}" -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/"${EBS_INSTALL_SNAPSHOT_VERSION}"/deploy/kubernetes/snapshot-controller/rbac-snapshot-controller.yaml
kubectl apply --kubeconfig "${KUBECONFIG}" -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/"${EBS_INSTALL_SNAPSHOT_VERSION}"/deploy/kubernetes/snapshot-controller/setup-snapshot-controller.yaml
kubectl apply --kubeconfig "${KUBECONFIG}" -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/"${EBS_INSTALL_SNAPSHOT_VERSION}"/client/config/crd/snapshot.storage.k8s.io_volumesnapshotclasses.yaml
kubectl apply --kubeconfig "${KUBECONFIG}" -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/"${EBS_INSTALL_SNAPSHOT_VERSION}"/client/config/crd/snapshot.storage.k8s.io_volumesnapshotcontents.yaml
kubectl apply --kubeconfig "${KUBECONFIG}" -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/"${EBS_INSTALL_SNAPSHOT_VERSION}"/client/config/crd/snapshot.storage.k8s.io_volumesnapshots.yaml
fi

loudecho "Deploying driver"
startSec=$(date +'%s')

Expand Down Expand Up @@ -201,19 +184,6 @@ loudecho "TEST_PASSED: ${TEST_PASSED}"
popd

OVERALL_TEST_PASSED="${TEST_PASSED}"
if [[ "${EBS_CHECK_MIGRATION}" == true ]]; then
exec 5>&1
OUTPUT=$(ebs_check_migration "${KUBECONFIG}" | tee /dev/fd/5)
MIGRATION_PASSED=$(echo "${OUTPUT}" | tail -1)
loudecho "MIGRATION_PASSED: ${MIGRATION_PASSED}"
if [ "${TEST_PASSED}" == 0 ] && [ "${MIGRATION_PASSED}" == 0 ]; then
loudecho "Both test and migration passed"
OVERALL_TEST_PASSED=0
else
loudecho "One of test or migration failed"
OVERALL_TEST_PASSED=1
fi
fi

PODS=$(kubectl get pod -n kube-system -l "app.kubernetes.io/name=${DRIVER_NAME},app.kubernetes.io/instance=${DRIVER_NAME}" -o json --kubeconfig "${KUBECONFIG}" | jq -r .items[].metadata.name)

Expand Down

0 comments on commit 6c2d1f3

Please sign in to comment.