Skip to content

Conversation

@pierluigilenoci
Copy link
Contributor

Summary

This PR fixes the image registry priority order to allow image.registry to take precedence over global.imageRegistry, which is the expected behavior in Helm charts.

Problem

After #367, when oauth2-proxy is used as a subchart and the parent chart sets global.imageRegistry, the local image.registry setting is ignored. This breaks existing configurations and is counter-intuitive.

Current behavior (broken):

  1. global.imageRegistry (highest priority) ❌
  2. image.registry
  3. quay.io (default in values.yaml)

Issue: If a parent chart sets global.imageRegistry to a private registry, oauth2-proxy cannot override it locally, even if the user explicitly sets image.registry.

Solution

Reverse the priority order to match standard Helm chart behavior:

New behavior (fixed):

  1. image.registry (highest priority) ✅
  2. global.imageRegistry
  3. quay.io (default in template)

Changes

  • deployment.yaml: Changed from {{ .Values.global.imageRegistry | default .Values.image.registry }} to {{ .Values.image.registry | default .Values.global.imageRegistry | default "quay.io" }}
  • values.yaml: Removed default registry value (now empty string), default moved to template
  • Chart.yaml: Bumped version to 10.1.0 (minor version for behavior change)

Impact

This is technically a behavior change, but it:

Testing

The change ensures:

  • If image.registry is set → use it (regardless of global.imageRegistry)
  • If only global.imageRegistry is set → use it (backward compatible)
  • If neither is set → use "quay.io" (maintains default behavior)

Fixes #379

@pierluigilenoci pierluigilenoci requested a review from tuunit January 7, 2026 09:58
@pierluigilenoci pierluigilenoci force-pushed the fix/image-registry-priority branch from 2bb1e57 to 2e1c667 Compare January 7, 2026 10:43
pierluigilenoci and others added 3 commits January 15, 2026 10:21
Local image.registry setting should take precedence over global.imageRegistry
to allow proper configuration when oauth2-proxy is used as a subchart.

Previous behavior:
1. global.imageRegistry (highest priority)
2. image.registry
3. quay.io (default in values.yaml)

New behavior:
1. image.registry (highest priority)
2. global.imageRegistry
3. quay.io (default in template)

This aligns with standard Helm chart behavior where local settings
override global settings.

Changes:
- Updated deployment.yaml template to prioritize local over global registry
- Removed default registry value from values.yaml (now defaults in template)
- Bumped chart version to 10.1.0 (minor version for behavior change)

Fixes oauth2-proxy#379

Signed-off-by: Pierluigi Lenoci <[email protected]>
Signed-off-by: Pierluigi Lenoci <[email protected]>
@pierluigilenoci pierluigilenoci force-pushed the fix/image-registry-priority branch from 8a0954c to dbfb349 Compare January 15, 2026 09:21
@tuunit tuunit merged commit c8f1449 into oauth2-proxy:main Jan 15, 2026
2 checks passed
@pierluigilenoci pierluigilenoci deleted the fix/image-registry-priority branch January 15, 2026 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Oauth2-Proxy can no longer be used as subchart since global registry settings take precedence over local registry settings

2 participants