Skip to content

Commit

Permalink
Make script executable
Browse files Browse the repository at this point in the history
  • Loading branch information
dargudear-google committed Dec 6, 2024
1 parent e17ba8e commit 942f7d0
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
4 changes: 2 additions & 2 deletions manifest_staging/deploy/secrets-store-csi-driver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
serviceAccountName: secrets-store-csi-driver
containers:
- name: node-driver-registrar
image: registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.11.1
image: gcr.io/gke-release/csi-node-driver-registrar@sha256:0227973552d00d31da87aaa81e70b875e5902e1835388edfea52f292e1773f75
args:
- --v=5
- --csi-address=/csi/csi.sock
Expand Down Expand Up @@ -91,7 +91,7 @@ spec:
cpu: 50m
memory: 100Mi
- name: liveness-probe
image: registry.k8s.io/sig-storage/livenessprobe:v2.13.1
image: gcr.io/gke-release/secret_manager_csi/livenessprobe@sha256:53b4dda8c8989a9149d924ba4cc4969235ee45384de2937fe5bcfbee53056017
imagePullPolicy: IfNotPresent
args:
- --csi-address=/csi/csi.sock
Expand Down
7 changes: 6 additions & 1 deletion test/bats/gcp.bats
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,19 @@ WAIT_TIME=60
SLEEP_TIME=1
NAMESPACE=default
PROVIDER_NAMESPACE=kube-system
PROVIDER_YAML=https://raw.githubusercontent.com/GoogleCloudPlatform/secrets-store-csi-driver-provider-gcp/main/deploy/provider-gcp-plugin.yaml
PROVIDER_YAML=https://raw.githubusercontent.com/GoogleCloudPlatform/secrets-store-csi-driver-provider-gcp/dargudear-sbom/deploy/provider-gcp-plugin.yaml
BASE64_FLAGS="-w 0"

export RESOURCE_NAME=${RESOURCE_NAME:-"projects/735463103342/secrets/test-secret-a/versions/latest"}
export FILE_NAME=${FILE_NAME:-"secret"}
export SECRET_VALUE=${SECRET_VALUE:-"aHVudGVyMg=="}

@test "install gcp provider" {

# echo "nameserver 8.8.8.8" >> /etc/resolv.conf
# systemctl restart network

archive_info
run kubectl apply -f $PROVIDER_YAML --namespace $PROVIDER_NAMESPACE
assert_success

Expand Down
2 changes: 2 additions & 0 deletions test/bats/helpers.bash
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ archive_info() {
LOGS_DIR=${ARTIFACTS}/$(date +"%FT%H%M%S")
mkdir -p "${LOGS_DIR}"

cat /etc/resolv.conf >> ${LOGS_DIR}/env.txt

# print all pod information
kubectl get pods -A -o json > ${LOGS_DIR}/pods.json

Expand Down
17 changes: 17 additions & 0 deletions test/scripts/run-e2e-gcp.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,24 @@ set -o errexit
set -o nounset
set -o pipefail

: "${GOOGLE_APPLICATION_CREDENTIALS:?Environment variable empty or not defined.}"

main() {
echo "Test string"
printenv
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
systemctl restart network

make e2e-bootstrap e2e-helm-deploy-release e2e-gcp

if [[ -z "$GOOGLE_APPLICATION_CREDENTIALS" ]]; then
cat <<EOF
GOOGLE_APPLICATION_CREDENTIALS is not set.
Please set this to the path of the service account used to run this script.
EOF
return 2
else
gcloud auth activate-service-account --key-file="${GOOGLE_APPLICATION_CREDENTIALS}"
fi

}

0 comments on commit 942f7d0

Please sign in to comment.