Skip to content

Commit

Permalink
Add basic registry proxy tests
Browse files Browse the repository at this point in the history
  • Loading branch information
carabasdaniel committed Dec 20, 2024
1 parent 0cecbe6 commit ef56ff0
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 14 deletions.
4 changes: 4 additions & 0 deletions charts/registry-proxy/templates/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ stringData:
remote_registry:
endpoint: {{ .Values.remoteEndpointURL | required "registry endpoint URL is required" }}
{{- if .Values.remoteEndpointScheme }}
scheme: {{.Values.remoteEndpointScheme }}
{{- end }}
{{- if .Values.remoteEndpointToken }}
token: {{.Values.remoteEndpointToken}}
{{- end}}
nats_listener:
enabled: false #set to true to enable manifest pushed notifications
Expand Down
2 changes: 1 addition & 1 deletion charts/registry-proxy/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ spec:
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
args: ["run", "--config-file", "/config/config.yaml"]
args: ["run", "--config", "/config/config.yaml"]
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
{{- with (include "aserto-lib.selfPorts" . | fromYaml )}}
Expand Down
2 changes: 2 additions & 0 deletions charts/registry-proxy/tests/test-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
remoteEndpointURL: "ghcr.io"
19 changes: 19 additions & 0 deletions charts/registry-proxy/tests/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
tests:
- name: registry-proxy-test
pull_secret: $GITHUB_TOKEN
deployments:
- chart: registry-proxy
values: test-values.yaml
ports:
8383: 8383
run:
- >
${POLICY:-policy} login -s localhost:8383 -u $GITHUB_USER -p $GITHUB_TOKEN -d --insecure
- >
time ${POLICY:-policy} pull localhost:8383/aserto-policies/policy-todo:latest --insecure
- >
time ${POLICY:-policy} pull localhost:8383/aserto-policies/policy-todo:latest --insecure
cleanup:
- >
exit 0
16 changes: 3 additions & 13 deletions charts/registry-proxy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@
image:
repository: ghcr.io/aserto-dev/registry-proxy
pullPolicy: IfNotPresent
tag: 0.0.2
# Overrides the image tag whose default is the chart appVersion.
# tag: x.y.z

# REQUIRED: specify and OIDC domain and audience
oidc:
domain: ""
audience: ""

# Set the service log level (trace/debug/info/warn/error)
# logLevel: info

Expand Down Expand Up @@ -53,20 +49,14 @@ ingress:
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: directory.example.com
- host: registry-proxy.example.com
port: https
- host: grpc.directory.example.com
- host: grpc.registry-proxy.example.com
port: grpc
paths:
- path: /
pathType: Prefix
tls: []
# - secretName: directory-example-com-tls
# hosts:
# - directory.example.com
# - secretName: grpc-directory-example-com-tls
# hosts:
# - grpc.directory.example.com

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
Expand Down

0 comments on commit ef56ff0

Please sign in to comment.