Skip to content

Commit

Permalink
correct-2kubectl
Browse files Browse the repository at this point in the history
  • Loading branch information
rohit010pa committed May 29, 2024
1 parent a96289d commit b7e95d3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions test/bats/vault.bats
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,10 @@ EOF
password=$(kubectl exec secrets-store-inline-basicauth-sync-rotate -- cat /mnt/secrets-store/db-basicauth-password )
[[ "$password" == "db-secret-password" ]]

username=$(oc get secrets/basicauthsecret -o=jsonpath="{.data.username}" | base64 -d)
username=$(kubectl get secrets/basicauthsecret -o=jsonpath="{.data.username}" | base64 -d)
[[ "$username" == "db-secret-username" ]]

password=$(oc get secrets/basicauthsecret -o=jsonpath="{.data.password}" | base64 -d)
password=$(kubectl get secrets/basicauthsecret -o=jsonpath="{.data.password}" | base64 -d)
[[ "$password" == "db-secret-password" ]]

result=$(kubectl exec secrets-store-inline-basicauth-sync-rotate -- printenv | grep SECRET_BASICAUTH | awk -F"=" '{ print $2 }' | tr -d '\r\n')
Expand Down Expand Up @@ -418,8 +418,6 @@ EOF
}

@test "Sync with dockerconfigjson K8s secrets - read vault secret from pod and dockerconfigjson secret" {
dockerexpectedvalue="{\"auths\": {\"https://index.docker.io/v1/\": {\"username\": \"tiger\",\"password\": \"pass1234\",\"email\": \"[email protected]\",\"auth\": \"dGlnZXI6cGFzczEyMzQ=\"}}}"

dockeroutputvalue=$(kubectl exec secrets-store-inline-dockerconfigjson-sync-rotate -- cat /mnt/secrets-store/dockerconfigjson)
[[ "$dockeroutputvalue" == "$dockerexpectedvalue" ]]

Expand Down

0 comments on commit b7e95d3

Please sign in to comment.