Azure Backend uses hardcoded `expiration_secs`
Maintainers usually reply within 4 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 74/100
Research direction
Start in controllers/repo_manager/secret.go, especially azureSettings() around lines 350-380, and inspect how the object storage Secret values become the generated STORAGES options. Add an optional expiration setting with the existing 60-second default, then verify that the generated Azure configuration uses the configured value while other backends remain unchanged.
Written by the indexing model from the issue text.
Description
Version
pulp-operator v2.0.0 (quay.io/pulp/pulp-operator:v2.0.0), Azure Blob backend
via object_storage_azure_secret, redirect_to_object_storage: true,
ingress_type: none.
Problem
azureSettings() writes a fixed "expiration_secs": 60 into the generated STORAGES options:
https://github.com/pulp/pulp-operator/blob/main/controllers/repo_manager/secret.go#L380
Every other Azure option in that block is taken from the object storage Secret, and neither the S3 nor the GCS block sets a URL lifetime at all, so Azure is the only backend with a hardcoded one.
With redirect_to_object_storage: true, the content app answers each request with a 302 to a SAS URL valid for 60 seconds. That is fine for package-sized content and unworkable for large artifacts: we serve installer ISOs of 5-6 GB, and a client that re-requests or resumes against the signed URL is refused with a bare 403 from Azure with no indication of the cause.
Attempts
AZURE_URL_EXPIRATION_SECSin the custom settings ConfigMap has no effect. django-storages passesOPTIONSto the backend constructor, and the constructor argument takes precedence over the settings name.- Editing
STORAGESfrom the custom settings ConfigMap is not possible either: the ConfigMap contents are rendered above the operator's generated block, so anything set there is overwritten, and code that mutatesSTORAGESin place raisesNameErrorbecause the dict does not exist yet at that point.
Impact
Redirect-to-object-storage is effectively limited to artifacts a client can fetch in under 60 seconds. Turning the redirect off is not an alternative on Azure, since the content app then calls storage.path() and every request fails with "This backend doesn't support absolute paths".
Suggested fix
Read the value from the object storage Secret, alongside the other Azure options, e.g. an optional azure-expiration-secs key defaulting to the current 60. Falling back to AZURE_URL_EXPIRATION_SECS when the user has set it would work equally well and matches what the django-storages docs mentions.
Workaround
Define STORAGES in the custom settings ConfigMap, which makes azureSettings() return early (secret.go#L350). This means restating the whole backend configuration, including account_key, in a ConfigMap unless the values are read from the environment.
...
Happy to contribute a fix in either direction!
- Dominant language
- Go
- Stars
- 88
- Forks
- 68
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 1
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pulp/pulp-operator
-
settings.py flaps between reconciles: needsMigrationSetting depends on map iteration orderPossibly taken @fontaineajulien claimed this 3 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
pulp/pulp-operator#1691 ·
Maintainers usually reply within 4 days
-
Documentation for metadata signing (APT/RPM) removed but still relevantMay be free again A pull request for this issue was closed without being merged. OpenIssue Triage-Needed
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
pulp/pulp-operator#1644 ·
Maintainers usually reply within 4 days
-
Feature Triage-Needed
Difficulty 5/5 Over a week Newbie friendliness 35/100
pulp/pulp-operator#1682 ·
Maintainers usually reply within 4 days
-
Issue Triage-Needed
Difficulty 3/5 1-2 days Newbie friendliness 45/100
pulp/pulp-operator#1647 ·
Maintainers usually reply within 4 days
-
Job definition for reset-admin-password doesn't propagate image pull policyMay be free again A pull request for this issue was closed without being merged. OpenIssue
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
pulp/pulp-operator#1630 ·
Maintainers usually reply within 4 days
All issues in pulp/pulp-operator
Similar issues
-
[correctness][missing-coverage][sort] Strict uniqueness checks lack numeric-key equivalence coverageOpen
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 69/100
SpecterOps/Janus#6 · 1 comment ·
-
Service process inherits the caller's cwd at first use, holding that folder open on Windows (EBUSY)Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
[docs] Media elements cannot load from a custom protocol (video/audio report MEDIA_ERR_SRC_NOT_SUPPORTED)Possibly taken @vst93 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day