Skip to content

Commit

Permalink
fix: set the default value for trustedIdentities
Browse files Browse the repository at this point in the history
Signed-off-by: Shahram Kalantari <[email protected]>
  • Loading branch information
shahramk64 committed Dec 30, 2024
1 parent 0e50cc4 commit 095e20c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
7 changes: 4 additions & 3 deletions charts/ratify/templates/verifier.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,11 @@ spec:
{{- end }}
{{- end}}
trustedIdentities:
{{- range $j, $store := $policy.trustedIdentities }}
{{- if eq $store "*" }}
{{- $trustedIdentities := $policy.trustedIdentities | default (list "*") }}
{{- range $j, $identity := $trustedIdentities }}
{{- if eq $identity "*" }}
- "*"
{{- else }}
{{- else }}
- "x509.subject: {{ . }}"
{{- end }}
{{- end }}
Expand Down
7 changes: 3 additions & 4 deletions test/bats/base-test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ RATIFY_NAMESPACE=gatekeeper-system
--set notation.trustPolicies[0].trustStores[1]=tsa:notationCerts[1] \
--set notation.trustPolicies[0].trustStores[2]=signingAuthority:notationCerts[2] \
--set notation.trustPolicies[1].registryScopes[0]="registry2.azurecr.io/" \
--set notation.trustPolicies[1].trustedIdentities[0]="cert identity 2" \
--set notation.trustPolicies[1].trustStores[0]=ca:notationCerts[1])

# the expected partial output
Expand Down Expand Up @@ -125,7 +124,7 @@ spec:
- ca:cert-0
- tsa:cert-1
- signingAuthority:cert-2
trustedIdentities:
trustedIdentities:
- "x509.subject: cert identity 1"
- name: trustPolicy-1
registryScopes:
Expand All @@ -134,8 +133,8 @@ spec:
level: strict
trustStores:
- ca:cert-3
trustedIdentities:
- "x509.subject: cert identity 2"
trustedIdentities:
- "*"
EOF
)

Expand Down

0 comments on commit 095e20c

Please sign in to comment.