You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by "thndrbrrr (via GitHub)" <gi...@apache.org> on 2023/12/09 04:24:37 UTC

[I] post-install hook job should also run post-upgrade [couchdb-helm]

thndrbrrr opened a new issue, #133:
URL: https://github.com/apache/couchdb-helm/issues/133

   The post-install job in `templates/job.yaml` is only executed when CouchDB is installed, but not when it is upgraded. This is problematic when CouchDB is used as a subchart but not installed initially due to a dependency condition.
   
   **Version of Helm and Kubernetes**:
   
   Helm: `3.13.2`
   Kubernetes: `1.28.3`
   
   **What happened**:
   
   Background: CouchDB is declared as a dependency in a parent chart with the condition `couchdb.enabled`.
   
   When initially installing the parent chart with `couchdb.enabled=false`, and then later upgrading the parent chart with `couchdb.enabled=true`, the post-install hook job is not run, and therefore cluster setup is not completed as expected (with  `autoSetup.enabled=true`).
   
   Which makes sense in a way because `helm install` != `helm upgrade`, but what I'm saying is that the job should also be run when CouchDB is added as part of an upgrade.
   
   **What you expected to happen**:
   
   Since `autoSetup.enabled` was set to `true`, it should have finalized the CouchDB cluster setup.
   
   **How to reproduce it** (as minimally and precisely as possible):
   
   1. Declare CouchDB as a subchart with a condition:
   ```
   dependencies:
     - name: couchdb
       version: 4.4.5
       repository: https://apache.github.io/couchdb-helm
       condition: couchdb.enabled
   ```
   2. Install parent chart with `helm install ... --set couchdb.enabled=false`.
   3. Upgrade parent chart with `helm install ... --wait --set couchdb.enabled=true`.
   
   **Anything else we need to know**:
   
   This is easily fixed by changing the job's annotation to
   ```
   annotations:
       "helm.sh/hook": post-install,post-upgrade
   ```
   Happy to provide a PR.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org