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

Deploying helm chart with existingSecret set on postgresql.auth and using SES email does not work #498

Closed
mortenmorten opened this issue Nov 12, 2024 · 5 comments · Fixed by #499
Labels
needs-triage Needs looking at to decide what to do

Comments

@mortenmorten
Copy link

Current Behavior

Deploying helm chart with existingSecret on postgresql and using SES for email fails.

Expected Behavior

It should not fail.

Steps To Reproduce

Deploy helm chart with this customization.yml (minified)

forge:
  email:
    enabled: true
    from: [email protected]
    ses:
      region: eu-west-1

postgresql:
  host: my-postgres-instance.rds.amazonaws.com
  port: 5432
  auth:
    existingSecret: rds-creds
    database: flowforge
    username: forge
    ssl: true

gives this error:

history.go:56: [debug] getting history for release flowforge
upgrade.go:158: [debug] preparing upgrade for flowforge
Error: UPGRADE FAILED: template: flowforge/templates/secrets.yaml:1:11: executing "flowforge/templates/secrets.yaml" at <include "forge.createSecret" .>: error calling include: template: flowforge/templates/_helpers.tpl:112:46: executing "forge.createSecret" at <.Values.forge.email.smtp.existingSecret>: nil pointer evaluating interface {}.existingSecret
helm.go:84: [debug] template: flowforge/templates/secrets.yaml:1:11: executing "flowforge/templates/secrets.yaml" at <include "forge.createSecret" .>: error calling include: template: flowforge/templates/_helpers.tpl:112:46: executing "forge.createSecret" at <.Values.forge.email.smtp.existingSecret>: nil pointer evaluating interface {}.existingSecret
UPGRADE FAILED

Environment

  • FlowFuse version: 2.9.0
  • Node.js version:
  • npm version:
  • Platform/OS:
  • Browser:

Linked Customers

  • Kunnusta
@mortenmorten mortenmorten added the needs-triage Needs looking at to decide what to do label Nov 12, 2024
@hardillb
Copy link
Contributor

Hi, thanks for raising this we'll have a look.

@hardillb
Copy link
Contributor

{{- define "forge.createSecret" -}}
{{- if not (and .Values.postgresql.auth.existingSecret 
    (not (and .Values.forge.email (not .Values.forge.email.smtp.existingSecret)))) -}}
true
{{- else -}}
false
{{- end -}}
{{- end -}}

Looks like this needs to be something like

{{- define "forge.createSecret" -}}
{{- if not (and .Values.postgresql.auth.existingSecret 
    (not (and .Values.forge.email.smtp (not .Values.forge.email.smtp.existingSecret)))) -}}
true
{{- else -}}
false
{{- end -}}
{{- end -}}

Might need an extra and block to check for email first

@hardillb
Copy link
Contributor

@mortenmorten a new version of the helm chart is being released

@Shrek53
Copy link

Shrek53 commented Nov 13, 2024

@hardillb
Couldn't there be an option to set the "forge.createSecret" from configuration side.
And If forge.createSecret is already set explicitly then we don't redefine it or overwrite it.

The current behavior does not take into account if "forge.createSecret" is set or not

@ppawlowski
Copy link
Contributor

@Shrek53 The forge.createSecret is a helper function which determines if the secret object should be or shouldn't be created based on multiple inputs. Having a single, configurable variable will increase helm chart configuration complexity.

However, as we are open to continuous improvement, feel free to raise a pull request with your proposal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage Needs looking at to decide what to do
Projects
Status: Closed / Done
Development

Successfully merging a pull request may close this issue.

4 participants