Skip to content

Commit

Permalink
updating e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
susanshi committed Oct 12, 2023
1 parent 820c06b commit 0205fe6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions pkg/verifier/notation/truststore.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ func (s trustStore) getCertificatesInternal(ctx context.Context, namedStore stri
// certs configured for this namedStore overrides cert path
if certGroup := s.certStores[namedStore]; len(certGroup) > 0 {
for _, certStore := range certGroup {

logger.GetLogger(ctx, logOpt).Infof("truststore getting certStore %v", certStore)
logger.GetLogger(ctx, logOpt).Debugf("truststore getting certStore %v", certStore)
result := certificatesMap[certStore]
if len(result) == 0 {
logger.GetLogger(ctx, logOpt).Warnf("no certificate fetched for certStore %+v", certStore)
Expand Down
8 changes: 4 additions & 4 deletions test/bats/base-test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ SLEEP_TIME=1

# add the alternate certificate as an inline certificate store
cat ~/.config/notation/truststore/x509/ca/alternate-cert/alternate-cert.crt | sed 's/^/ /g' >>./test/bats/tests/config/config_v1beta1_certstore_inline.yaml
run kubectl apply -f ./test/bats/tests/config/config_v1beta1_certstore_inline.yaml
run kubectl apply -f ./test/bats/tests/config/config_v1beta1_certstore_inline.yaml --namespace gatekeeper-system
assert_success
sed -i '9,$d' ./test/bats/tests/config/config_v1beta1_certstore_inline.yaml

Expand Down Expand Up @@ -198,7 +198,7 @@ SLEEP_TIME=1

@test "validate image signed by leaf cert" {
teardown() {
wait_for_process ${WAIT_TIME} ${SLEEP_TIME} 'kubectl delete certificatestores.config.ratify.deislabs.io/certstore-inline --namespace default --ignore-not-found=true'
wait_for_process ${WAIT_TIME} ${SLEEP_TIME} 'kubectl delete certificatestores.config.ratify.deislabs.io/certstore-inline --namespace gatekeeper-system --ignore-not-found=true'
wait_for_process ${WAIT_TIME} ${SLEEP_TIME} 'kubectl delete pod demo-leaf --namespace default --force --ignore-not-found=true'
wait_for_process ${WAIT_TIME} ${SLEEP_TIME} 'kubectl delete pod demo-leaf2 --namespace default --force --ignore-not-found=true'

Expand All @@ -214,7 +214,7 @@ SLEEP_TIME=1

# add the root certificate as an inline certificate store
cat ~/.config/notation/truststore/x509/ca/leaf-test/root.crt | sed 's/^/ /g' >>./test/bats/tests/config/config_v1beta1_certstore_inline.yaml
run kubectl apply -f ./test/bats/tests/config/config_v1beta1_certstore_inline.yaml
run kubectl apply -f ./test/bats/tests/config/config_v1beta1_certstore_inline.yaml --namespace gatekeeper-system
assert_success
sed -i '9,$d' ./test/bats/tests/config/config_v1beta1_certstore_inline.yaml

Expand All @@ -228,7 +228,7 @@ SLEEP_TIME=1

# add the root certificate as an inline certificate store
cat ~/.config/notation/truststore/x509/ca/leaf-test/leaf.crt | sed 's/^/ /g' >>./test/bats/tests/config/config_v1beta1_certstore_inline.yaml
run kubectl apply -f ./test/bats/tests/config/config_v1beta1_certstore_inline.yaml
run kubectl apply -f ./test/bats/tests/config/config_v1beta1_certstore_inline.yaml --namespace gatekeeper-system
assert_success
sed -i '9,$d' ./test/bats/tests/config/config_v1beta1_certstore_inline.yaml

Expand Down

0 comments on commit 0205fe6

Please sign in to comment.