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 #305

Merged
merged 1 commit into from
Jan 28, 2022

Conversation

somtochiama
Copy link
Member

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 ImageUpdateAutomation.spec.sourceRef.namespace refers to a GitRepository in a different namespace than the ImageUpdateAutomation object, the reconciliation will fail with the AccessDenied reason.

On access denied the controller sends logs and events e.g

{"level":"error","ts":"2022-01-27T15:00:20.108Z","logger":"controller.imageupdateautomation","msg":"access denied to cross-namespaced resource","reconciler group":"image.toolkit.fluxcd.io","reconciler kind":"ImageUpdateAutomation","name":"imageupdateautomation-sample","namespace":"flux-system","error":"can't access 'GitRepository/default/sample-repo', cross-namespace references have been blocked"}

Part of flux2#2337

@stefanprodan stefanprodan added the enhancement New feature or request label Jan 27, 2022
docs/spec/v1beta1/imageupdateautomations.md Outdated Show resolved Hide resolved
docs/spec/v1beta1/imageupdateautomations.md Outdated Show resolved Hide resolved
docs/spec/v1beta1/imageupdateautomations.md Outdated Show resolved Hide resolved
docs/spec/v1beta1/imageupdateautomations.md Outdated Show resolved Hide resolved
docs/spec/v1beta1/imageupdateautomations.md Outdated Show resolved Hide resolved
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 6aaf01a into fluxcd:main Jan 28, 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