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

Allow disabling cross-namespace references #408

Merged
merged 1 commit into from
Jan 31, 2022

Conversation

somtochiama
Copy link
Member

@somtochiama somtochiama commented Jan 28, 2022

Introduce the flag --no-cross-namespace-refs (defaults to false) for allowing cluster admins to disable cross-namespace references to sources.

When the controller is run with --no-cross-namespace-refs=true and chart.spec.sourceRef refers to a GitRepository, Bucket or HelmRepository in a different namespace than the HelmRelease object, the reconciliation will fail with the AccessDenied reason.

On access denied errors the controller logs and sends an event e.g.:

can't access 'GitRepository/my-other-namespace/my-source', cross-namespace references have been blocked

And the HelmRelease status Ready condition it set to:

status:
  conditions:
  - lastTransitionTime: "2022-01-26T07:26:48Z"
    message: "can't access 'GitRepository/my-other-namespace/my-source', cross-namespace references have been blocked"
    reason: AccessDenied
    status: "False"
    type: Ready

Part of: fluxcd/flux2#2337

Makefile Outdated Show resolved Hide resolved
docs/spec/v2beta1/helmreleases.md Outdated Show resolved Hide resolved
@stefanprodan stefanprodan changed the title Add flag to disable cross namespace references Allow disabling cross-namespace references Jan 29, 2022
@stefanprodan stefanprodan added the enhancement New feature or request label Jan 29, 2022
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks @somtochiama

@stefanprodan stefanprodan merged commit 5a293d2 into fluxcd:main Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants