diff --git a/test/bats/base-test.bats b/test/bats/base-test.bats index f5434126d..f68bbd5cc 100644 --- a/test/bats/base-test.bats +++ b/test/bats/base-test.bats @@ -14,10 +14,12 @@ RATIFY_NAMESPACE=gatekeeper-system wait_for_process ${WAIT_TIME} ${SLEEP_TIME} 'kubectl delete pod demo1 --namespace default --force --ignore-not-found=true' # restore cert store in ratify namespace - run kubectl get certificatestores.config.ratify.deislabs.io/ratify-notation-inline-cert -o yaml -n default > currentCertStore.yaml + run kubectl get certificatestores.config.ratify.deislabs.io/ratify-notation-inline-cert -o yaml -n default > certStore.yaml run kubectl delete certificatestores.config.ratify.deislabs.io/ratify-notation-inline-cert -n default - run kubectl apply -n {RATIFY_NAMESPACE} -f currentCertStore.yaml - + sed 's/default/gatekeeper-system/' certStore.yaml > certStoreNewNS.yaml + run kubectl apply -f certStoreNewNS.yaml + assert_success + # restore the original notation verifier for other tests wait_for_process ${WAIT_TIME} ${SLEEP_TIME} 'kubectl apply -f ./config/samples/config_v1beta1_verifier_notation.yaml' } @@ -29,8 +31,10 @@ RATIFY_NAMESPACE=gatekeeper-system sleep 5 # apply the certstore to default namespace - run kubectl get certificatestores.config.ratify.deislabs.io/ratify-notation-inline-cert -o yaml -n {RATIFY_NAMESPACE} > currentCertStore.yaml - run kubectl apply -n default -f currentCertStore.yaml + run kubectl get certificatestores.config.ratify.deislabs.io/ratify-notation-inline-cert -o yaml -n {RATIFY_NAMESPACE} > certStore.yaml + sed 's/gatekeeper-system/default/' certStore.yaml > certStoreNewNS.yaml + run kubectl apply -f certStoreNewNS.yaml + assert_success run kubectl delete certificatestores.config.ratify.deislabs.io/ratify-notation-inline-cert -n {RATIFY_NAMESPACE} # configure the notation verifier to use inline certificate store with specific namespace