From 65a595ab39b7154fde3efb137e2f4037b6d4862f Mon Sep 17 00:00:00 2001 From: Pedro Brochado Date: Mon, 13 Jan 2025 15:48:56 -0300 Subject: [PATCH] Apply plugin-template with override policy --- .ci/ansible/settings.py.j2 | 35 ++++++++++++---------------- .github/template_gitref | 2 +- .github/workflows/scripts/install.sh | 2 +- 3 files changed, 17 insertions(+), 22 deletions(-) diff --git a/.ci/ansible/settings.py.j2 b/.ci/ansible/settings.py.j2 index 9b5f5f4be4..9df96c3f97 100644 --- a/.ci/ansible/settings.py.j2 +++ b/.ci/ansible/settings.py.j2 @@ -22,35 +22,30 @@ API_ROOT = {{ api_root | repr }} {% if pulp_scenario_settings is defined and pulp_scenario_settings %} {% for key, value in pulp_scenario_settings.items() %} +{% if key != "STORAGES" %} {{ key | upper }} = {{ value | repr }} +{% endif %} {% endfor %} {% endif %} {% if s3_test | default(false) %} MEDIA_ROOT: "" S3_USE_SIGV4 = True -STORAGES = { - "default": { - "BACKEND": "storages.backends.s3boto3.S3Boto3Storage", - "OPTIONS": { - "access_key": "{{ minio_access_key }}", - "secret_key": "{{ minio_secret_key }}", - "region_name": "eu-central-1", - "addressing_style": "path", - "signature_version": "s3v4", - "bucket_name": "pulp3", - "endpoint_url": "http://minio:9000", - "default_acl": "@none None", - }, - }, - "staticfiles": { - "BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage", - }, -} +{% if "STORAGES" in pulp_scenario_settings %} +STORAGES = {{ pulp_scenario_settings["STORAGES"] }} +{% else %} +DEFAULT_FILE_STORAGE = "storages.backends.s3boto3.S3Boto3Storage" +AWS_ACCESS_KEY_ID = "{{ minio_access_key }}" +AWS_SECRET_ACCESS_KEY = "{{ minio_secret_key }}" +AWS_S3_REGION_NAME = "eu-central-1" +AWS_S3_ADDRESSING_STYLE = "path" +AWS_S3_SIGNATURE_VERSION = "s3v4" +AWS_STORAGE_BUCKET_NAME = "pulp3" +AWS_S3_ENDPOINT_URL = "http://minio:9000" +AWS_DEFAULT_ACL = "@none None" +{% endif %} {% endif %} -# This is using DEFAULT_FILE_STORAGE to test both usages. -# Remove when DEFAULT_FILE_STORAGE is completely removed. {% if azure_test | default(false) %} DEFAULT_FILE_STORAGE = "storages.backends.azure_storage.AzureStorage" MEDIA_ROOT = "" diff --git a/.github/template_gitref b/.github/template_gitref index 51006453fe..c0a9ef57aa 100644 --- a/.github/template_gitref +++ b/.github/template_gitref @@ -1 +1 @@ -2021.08.26-417-gcec8e48 +2021.08.26-417-gcec8e48-dirty diff --git a/.github/workflows/scripts/install.sh b/.github/workflows/scripts/install.sh index e8bebd1f73..18e9f2a0dc 100755 --- a/.github/workflows/scripts/install.sh +++ b/.github/workflows/scripts/install.sh @@ -105,7 +105,7 @@ if [ "$TEST" = "s3" ]; then sed -i -e '$a s3_test: true\ minio_access_key: "'$MINIO_ACCESS_KEY'"\ minio_secret_key: "'$MINIO_SECRET_KEY'"\ -pulp_scenario_settings: {"DISABLED_authentication_backends": "@merge django.contrib.auth.backends.RemoteUserBackend", "DISABLED_authentication_json_header": "HTTP_X_RH_IDENTITY", "DISABLED_authentication_json_header_jq_filter": ".identity.user.username", "DISABLED_authentication_json_header_openapi_security_scheme": {"description": "External OAuth integration", "flows": {"clientCredentials": {"scopes": {"api.console": "grant_access_to_pulp"}, "tokenUrl": "https://your-identity-provider/token/issuer"}}, "type": "oauth2"}, "DISABLED_rest_framework__default_authentication_classes": "@merge pulpcore.app.authentication.JSONHeaderRemoteAuthentication", "domain_enabled": true, "hide_guarded_distributions": true, "rest_framework__default_permission_classes": ["pulpcore.plugin.access_policy.AccessPolicyFromSettings"]}\ +pulp_scenario_settings: {"DISABLED_authentication_backends": "@merge django.contrib.auth.backends.RemoteUserBackend", "DISABLED_authentication_json_header": "HTTP_X_RH_IDENTITY", "DISABLED_authentication_json_header_jq_filter": ".identity.user.username", "DISABLED_authentication_json_header_openapi_security_scheme": {"description": "External OAuth integration", "flows": {"clientCredentials": {"scopes": {"api.console": "grant_access_to_pulp"}, "tokenUrl": "https://your-identity-provider/token/issuer"}}, "type": "oauth2"}, "DISABLED_rest_framework__default_authentication_classes": "@merge pulpcore.app.authentication.JSONHeaderRemoteAuthentication", "STORAGES": {"default": {"BACKEND": "storages.backends.s3boto3.S3Boto3Storage", "OPTIONS": {"access_key": "{{ minio_access_key }}", "addressing_style": "path", "bucket_name": "pulp3", "default_acl": "@none None", "endpoint_url": "http://minio:9000", "region_name": "eu-central-1", "secret_key": "{{ minio_secret_key }}", "signature_version": "s3v4"}}, "staticfiles": {"BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage"}}, "domain_enabled": true, "hide_guarded_distributions": true, "rest_framework__default_permission_classes": ["pulpcore.plugin.access_policy.AccessPolicyFromSettings"]}\ pulp_scenario_env: {}\ ' vars/main.yaml export PULP_API_ROOT="/rerouted/djnd/"