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

extraConfig fails #376

Open
pimvandenbroek opened this issue Oct 3, 2024 · 5 comments · May be fixed by #377
Open

extraConfig fails #376

pimvandenbroek opened this issue Oct 3, 2024 · 5 comments · May be fixed by #377
Labels
bug Something isn't working

Comments

@pimvandenbroek
Copy link

Hi,

remoteAuth.backends accepts an array according to the documentation, however this breaks in netbox-5.0.0-beta.112...netbox-5.0.0-beta.113

The range option is removed here, causing a Error: YAML parse error on netbox/templates/cronjob.yaml: error converting YAML to JSON: yaml: line 77: mapping values are not allowed in this context

Is the documentation outdated in this case?

Thanks in advance!

@LeoColomb
Copy link
Member

LeoColomb commented Oct 3, 2024

Thanks for filing this issue, @pimvandenbroek.
The range function has been replaced with has, which checks whether a value is in an array (actually list/slice) or not.
Would you mind providing your values?

@pimvandenbroek
Copy link
Author

pimvandenbroek commented Oct 3, 2024

The relevant values:

backends:
    - netbox.authentication.RemoteUserBackend
    - social_core.backends.google.GoogleOAuth2

This should still work, as the important part (for us) is in the configmap:
REMOTE_AUTH_BACKEND: {{ toJson .Values.remoteAuth.backends }}

@LeoColomb
Copy link
Member

I can't reproduce, no error when templating and the output looks fine.

$ helm template charts/netbox --values 376-values.yaml | grep 'REMOTE_AUTH_BACKEND'
    REMOTE_AUTH_BACKEND: ["netbox.authentication.RemoteUserBackend","social_core.backends.google.GoogleOAuth2"]

Where 376-values.yaml:

remoteAuth:
  enabled: true
  backends:
      - netbox.authentication.RemoteUserBackend
      - social_core.backends.google.GoogleOAuth2

@pimvandenbroek
Copy link
Author

pimvandenbroek commented Oct 3, 2024

You are right. After some additional checking, I've found the following to be the culprit:

extraConfig:
  - secret: # same as pod.spec.volumes.secret
      secretName: "netbox-google-sso-dev"
  - values:
      SOCIAL_AUTH_GOOGLE_OAUTH2_WHITELISTED_DOMAINS: ["domain.com"]

Not sure if we're trying to implement it incorrectly, but in 112 it worked correctly.

LeoColomb added a commit that referenced this issue Oct 3, 2024
Ensure newlines and spaces are consistent
Fixes remoteAuth backends config fails #376
@LeoColomb LeoColomb linked a pull request Oct 3, 2024 that will close this issue
@LeoColomb
Copy link
Member

Should be fixed via #377

@LeoColomb LeoColomb added the bug Something isn't working label Oct 3, 2024
@LeoColomb LeoColomb changed the title remoteAuth backends config fails extraConfig fails Oct 3, 2024
LeoColomb added a commit that referenced this issue Oct 3, 2024
Ensure newlines and spaces are consistent
Fixes remoteAuth backends config fails #376
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants