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

Adds APP_URL as base tag href to enable loading via ui via ingress ro… #2195

Merged
merged 1 commit into from
Feb 15, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/postgres-operator-ui/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ spec:
{{- toYaml .Values.resources | nindent 12 }}
env:
- name: "APP_URL"
value: "http://localhost:8081"
value: {{ .Values.envs.appUrl }}
- name: "OPERATOR_API_URL"
value: {{ .Values.envs.operatorApiUrl | quote }}
- name: "OPERATOR_CLUSTER_NAME_LABEL"
Expand Down
1 change: 1 addition & 0 deletions charts/postgres-operator-ui/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ resources:
envs:
# IMPORTANT: While operator chart and UI chart are independent, this is the interface between
# UI and operator API. Insert the service name of the operator API here!
appUrl: "http://localhost:8081"
operatorApiUrl: "http://postgres-operator:8080"
operatorClusterNameLabel: "cluster-name"
resourcesVisible: "False"
Expand Down
2 changes: 1 addition & 1 deletion ui/operator_ui/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def send_js(path):
@app.route('/')
@authorize
def index():
return render_template('index.html', google_analytics=GOOGLE_ANALYTICS)
return render_template('index.html', google_analytics=GOOGLE_ANALYTICS, app_url=APP_URL)


DEFAULT_UI_CONFIG = {
Expand Down
1 change: 1 addition & 0 deletions ui/operator_ui/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<base href="{{app_url}}">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@simo9000 unfortunately, this change introduces a breaking change, see #2302. Now everybody has to set appUrl because with the default localhost appUrl as base the app will not load. App URL is only used for authorization. The rest is full links. Maybe most users haven't used it so having it hardcoded in deployment.yaml template was fine. I have to read up on ingress rules, but can you tell us why you need this to be changed?

<title>PostgreSQL Operator UI</title>


Expand Down