Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add zarf variable to api package for exposing the OpenAPI specification #503

Merged
merged 3 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:
run: |
make build-api LOCAL_VERSION=e2e-test
docker image prune -af
uds zarf package deploy packages/api/zarf-package-leapfrogai-api-amd64-e2e-test.tar.zst --confirm
uds zarf package deploy packages/api/zarf-package-leapfrogai-api-amd64-e2e-test.tar.zst --set=EXPOSE_OPENAPI_SCHEMA=true --confirm
rm packages/api/zarf-package-leapfrogai-api-amd64-e2e-test.tar.zst

##########
Expand Down
8 changes: 5 additions & 3 deletions packages/api/chart/templates/uds-package.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.api.exposeOpenAPISchema }}
apiVersion: uds.dev/v1alpha1
kind: Package
metadata:
Expand All @@ -6,11 +7,11 @@ metadata:
spec:
network:
expose:
- service: api
- service: api
podLabels:
app: api
host: {{ .Values.package.host }}
gateway: tenant
gateway: tenant
port: 8080

allow:
Expand All @@ -19,8 +20,9 @@ spec:

- direction: Egress
remoteGenerated: Anywhere

- direction: Egress
podLabels:
app: api
remoteGenerated: Anywhere
{{- end }}
1 change: 1 addition & 0 deletions packages/api/chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ image:
api:
replicas: 1
port: 8080
exposeOpenAPISchema: false

package:
host: leapfrogai-api
3 changes: 3 additions & 0 deletions packages/api/lfai-values.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
image:
lfaiAPITag: ###ZARF_CONST_LEAPFROGAI_API_VERSION###
kiwigridTag: ###ZARF_CONST_KIWIGRID_VERSION###

api:
exposeOpenAPISchema: ###ZARF_VAR_EXPOSE_OPENAPI_SCHEMA###
5 changes: 5 additions & 0 deletions packages/api/zarf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ constants:
- name: KIWIGRID_VERSION
value: "1.23.3"

variables:
- name: EXPOSE_OPENAPI_SCHEMA
default: "false"
description: "Flag to expose the OpenAPI schema for debugging."

components:
- name: leapfrogai
required: true
Expand Down