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

fix: allow using a different namespace for the auth #1486

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

taktakpeops
Copy link

@taktakpeops taktakpeops commented Aug 7, 2024

Use different namespace for fetching the auth secret for Git in case it's specified

Use case:

revision ->

apiVersion: terraform.appvia.io/v1alpha1
kind: Revision
metadata:
  name: my-revision
  namespace: my-ns
spec:
  # more config
  configuration:
    auth:
      name: auth
      namespace: other-ns

In this case the controller fails because it can't find the auth secret in my-ns.

My PR checks if spec.configuration.auth.namespace is set and use this namespace in case it's present to get the secret

Copy link
Member

@gambol99 gambol99 left a comment

Choose a reason for hiding this comment

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

Very sorry for the length of time passed on this review @taktakpeops!! … been away for an extended holiday

The only concern adding the feature; it technically allows for a user to circumvent permissions and gain access to secrets in other namespaces i.e. just write a module that prints the x variables, reference a secret in another namespace and you can grab the log outputs …

What was the use case you were looking to fix?

cc @KashifSaadat

@gambol99
Copy link
Member

gambol99 commented Aug 28, 2024

Very sorry for the length of time passed on this review @taktakpeops!! … been away for an extended holiday

The only concern adding the feature; it technically allows for a user to circumvent permissions and gain access to secrets in other namespaces i.e. just write a module that prints the x variables, reference a secret in another namespace and you can grab the log outputs …

What was the use case you were looking to fix?

cc @KashifSaadat

Back from holiday blunder! :-) … i was thinking about variables not auth, this should technically be fine .. I’m wondering if using https://terranetes.appvia.io/terranetes-controller/admin/defaults/#secrets would fix your issue without changes - assuming the use case you want is a shared secret for auth in the Revisions

@gambol99 gambol99 self-requested a review August 28, 2024 14:35
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.

2 participants