From dff3be037922bdaefd34630298fd58fdf1d1c9c3 Mon Sep 17 00:00:00 2001 From: Cristhian Garcia Date: Fri, 14 Jun 2024 12:56:59 -0500 Subject: [PATCH] fix: address PR suggestions --- .github/environments/enabled/config.yml | 13 +++++++++++++ README.md | 1 + drydock/patches/kustomization-resources | 2 +- drydock/plugin.py | 13 +------------ 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/.github/environments/enabled/config.yml b/.github/environments/enabled/config.yml index 35ba58a1..d30cd995 100644 --- a/.github/environments/enabled/config.yml +++ b/.github/environments/enabled/config.yml @@ -30,3 +30,16 @@ DRYDOCK_PDB_MINAVAILABLE_PERCENTAGE_LMS_WORKER: 50 DRYDOCK_PDB_MINAVAILABLE_PERCENTAGE_CMS: 50 DRYDOCK_PDB_MINAVAILABLE_PERCENTAGE_CMS_WORKER: 50 DRYDOCK_MIGRATE_FROM: 13 +NGINX_STATIC_CACHE_CONFIG: + lms: + host: {{LMS_HOST}} + path: /static/ + port: 8000 + cms: + host: {{CMS_HOST}} + path: /static/ + port: 8000 + mfe: + host: {{MFE_HOST}} + path: /static/ + port: 8000 diff --git a/README.md b/README.md index 9d8b7af6..0c0c466e 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,7 @@ The following configuration options are available: - `DRYDOCK_ENABLE_SENTRY`: Whether to enable sentry. Defaults to `true`. - `DRYDOCK_SENTRY_DSN`: The sentry DSN. Defaults to `""`. - `DRYDOCK_POD_LIFECYCLE`: Whether to enable pod lifecycle. Defaults to `true`. +- `NGINX_STATIC_CACHE_CONFIG`: A list of dictionaries with settings for different services to cache their assets in NGINX. - `DRYDOCK_PDB_MINAVAILABLE_PERCENTAGE_MFE`: The minimum available percentage for the MFE's PodDisruptionBudget. To disable the PodDisruptionBudget, set `0`. Defaults to `0`. - `DRYDOCK_PDB_MINAVAILABLE_PERCENTAGE_FORUM`: The minimum available percentage for the FORUM's PodDisruptionBudget. To disable the PodDisruptionBudget, set `0`. Defaults to `0`. - `DRYDOCK_PDB_MINAVAILABLE_PERCENTAGE_CADDY`: The minimum available percentage for the CADDY's PodDisruptionBudget. To disable the PodDisruptionBudget, set `0`. Defaults to `0`. diff --git a/drydock/patches/kustomization-resources b/drydock/patches/kustomization-resources index eb2069cf..291028b8 100644 --- a/drydock/patches/kustomization-resources +++ b/drydock/patches/kustomization-resources @@ -12,7 +12,7 @@ - plugins/drydock/k8s/ingress/cms.yml - plugins/drydock/k8s/ingress/mfe.yml - plugins/drydock/k8s/ingress/extra-hosts.yml -{% if DRYDOCK_NGINX_STATIC_CACHE_CONFIG %}- plugins/drydock/k8s/ingress/static-cache.yml{%- endif %} +- plugins/drydock/k8s/ingress/static-cache.yml {%- endif %} {% if DRYDOCK_DEBUG -%} - plugins/drydock/k8s/debug/deployments.yml diff --git a/drydock/plugin.py b/drydock/plugin.py index 192ca5a1..dcb56003 100644 --- a/drydock/plugin.py +++ b/drydock/plugin.py @@ -162,18 +162,7 @@ def get_sync_waves_for_resource(resource_name: str) -> SYNC_WAVES_ORDER_ATTRS_TY "lms-worker", "cms-worker", ], - "NGINX_STATIC_CACHE_CONFIG": { - "lms": { - "host": "{{ LMS_HOST }}", - "path": "/static/", - "port": 8000, - }, - "cms": { - "host": "{{ CMS_HOST }}", - "path": "/static/", - "port": 8000, - }, - }, + "NGINX_STATIC_CACHE_CONFIG": {}, }, # Add here settings that don't have a reasonable default for all users. For # instance: passwords, secret keys, etc.