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

EnableDBAccess defaults to false when using OperatorConfiguration #2575

Open
andsens opened this issue Mar 13, 2024 · 1 comment
Open

EnableDBAccess defaults to false when using OperatorConfiguration #2575

andsens opened this issue Mar 13, 2024 · 1 comment

Comments

@andsens
Copy link

andsens commented Mar 13, 2024

Please, answer some short questions which should help us to understand your problem / question better?

  • Which image of the operator are you using? registry.opensource.zalan.do/acid/postgres-operator:v1.10.1
  • Where do you run it K8S with kops on AWS
  • Are you running Postgres Operator in production? Not yet
  • Type of issue? Bug report

When using OperatorConfiguration EnableDBAccess is false, when not specifying it as evidenced by the startup output (kudos for printing that during startup btw):

...
time="2024-03-13T14:19:41Z" level=info msg="   \"EnableEBSGp3Migration\": false," pkg=controller
time="2024-03-13T14:19:41Z" level=info msg="   \"EnableEBSGp3MigrationMaxSize\": 1000," pkg=controller
time="2024-03-13T14:19:41Z" level=info msg="   \"DebugLogging\": false," pkg=controller
time="2024-03-13T14:19:41Z" level=info msg="   \"EnableDBAccess\": false," pkg=controller
time="2024-03-13T14:19:41Z" level=info msg="   \"EnableTeamsAPI\": false," pkg=controller
time="2024-03-13T14:19:41Z" level=info msg="   \"EnableTeamSuperuser\": false," pkg=controller
time="2024-03-13T14:19:41Z" level=info msg="   \"TeamAdminRole\": \"admin\"," pkg=controller
...

The documentation states it should be true.

The OperatorConfiguration looks like this (slightly edited):

---
apiVersion: acid.zalan.do/v1
kind: OperatorConfiguration
metadata:
  name: main
configuration:
  enable_crd_registration: false
  kubernetes:
    watched_namespace: "*"
    inherited_labels:
    - app.kubernetes.io/name
    cluster_labels:
      app.kubernetes.io/component: postgresql
    pod_antiaffinity_preferred_during_scheduling: true
    pod_antiaffinity_topology_key: topology.kubernetes.io/zone
  teams_api:
    enable_teams_api: false

Adding

  debug:
    enable_database_access: true

fixes this issue.

@FxKu
Copy link
Member

FxKu commented Mar 14, 2024

This probably applies to many config settings which use the type bool which are true by default. Usually, we assign the defaults here using coalesce functions. But not for bool because actually type *bool should be used when default is true.

Probably the easiest solution now is to add a coalesce function for bool type and define defaults like here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants