Skip to content

Commit

Permalink
update ns
Browse files Browse the repository at this point in the history
  • Loading branch information
susanshi committed Oct 17, 2023
1 parent a520e42 commit c371bb6
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions test/bats/base-test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Expand All @@ -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
Expand Down

0 comments on commit c371bb6

Please sign in to comment.