Skip to content

Commit

Permalink
Unset the image tag so users have to specify it explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverguenther committed Oct 8, 2024
1 parent 74758c4 commit 5f01a5d
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 12 deletions.
6 changes: 6 additions & 0 deletions .changeset/gold-cows-wash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@openproject/helm-charts": major
---

Unset the image tag so users have to specify it explicitly. The problem with using `14-stable` is that new releases will auto rollover
and break as the migration and seeding job is not being run. Upgrades between versions should be explicit.
7 changes: 6 additions & 1 deletion .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,9 @@ jobs:
if: steps.list-changed.outputs.changed == 'true'

- name: Run chart-testing (install)
run: ct install --target-branch ${{ github.event.repository.default_branch }} --chart-repos bitnami=https://charts.bitnami.com/bitnami --helm-extra-set-args "--set environment.OPENPROJECT_HTTPS=false --set persistence.accessModes=[ReadWriteOnce]" --helm-extra-args "--timeout 600s"
run: |
ct install \
--target-branch ${{ github.event.repository.default_branch }} \
--chart-repos bitnami=https://charts.bitnami.com/bitnami \
--helm-extra-set-args "--set image.tag=14.5.1 --set environment.OPENPROJECT_HTTPS=false --set persistence.accessModes=[ReadWriteOnce]" \
--helm-extra-args "--timeout 600s"
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.3.3
3.3.4
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ We publish newer versions of this chart to the GitHub package registry: https://

We sign our chart using the [Helm Provenance and Integrity](https://helm.sh/docs/topics/provenance/) functionality. You can find the used public key here

- https://github.com/opf/helm-charts/blob/main/signing.key
- https://github.com/opf/helm-charts/blob/main/signing.key
- https://keys.openpgp.org/vks/v1/by-fingerprint/CB1CA0488A75B7471EA1B087CF56DD6A0AE260E5

# Contribution

We welcome all contributions. For the release management, we're using the [changeset action](https://github.com/changesets/action) to generate the changelog and maintain the release process.
We welcome all contributions. For the release management, we're using the [changeset action](https://github.com/changesets/action) to generate the changelog and maintain the release process.
12 changes: 11 additions & 1 deletion charts/openproject/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ helm repo update
Install the OpenProject chart in a dedicated `openproject` namespace:

```shell
helm upgrade --create-namespace --namespace openproject --install openproject openproject/openproject
helm upgrade --create-namespace --namespace openproject \
--install openproject openproject/openproject \
--set image.tag=14.5.1
```

The namespace is optional, but we highly recommend it as it does make it easier to manage the resources created for OpenProject.
Expand Down Expand Up @@ -130,6 +132,14 @@ s3:
# port:
```

### Updating the release

In case you update the release of OpenProject on the same version of the helm chart, you can use the `helm upgrade` command to update the release.

```shell
helm upgrade --reuse-values --namespace openproject my-openproject --set image.tag=14.6.0
```
Find out more about the [configuration through environment variables](https://www.openproject.org/docs/installation-and-operations/configuration/environment/) section.


### Updating the configuration
Expand Down
2 changes: 2 additions & 0 deletions charts/openproject/templates/web-deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{- $image_tag := .Values.image.tag | required ".Values.image.tag is required. Please use the -slim variant from OpenProject and fix it to a full release version X.Y.Z" -}}

---
apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
kind: Deployment
Expand Down
5 changes: 2 additions & 3 deletions charts/openproject/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,8 @@ image:

## Define image tag.
## For the helm chart, use the `-slim` variants as the all-in-one container is not compatible
## with some of the options (non-root execution, password splitting, etc.) and is inefficient for using in helm
## due to embedded a number of services.
tag: "14-slim"
# For the latest version, see https://hub.docker.com/r/openproject/openproject/tags
tag:

## Define image sha256 - mutual exclusive with image tag.
## The sha256 has a higher precedence than
Expand Down
14 changes: 10 additions & 4 deletions spec/helm_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,19 @@ def self.with_defaults(yaml)
yaml.is_a?(Hash) ? yaml : YAML.safe_load(yaml)
end

def initialize(values, chart = 'openproject', release_name = 'optest', extra_args = '')
debug(values, chart, release_name, extra_args)
def initialize(values, chart = 'openproject')
debug(values, chart, '14-stable')
end

def debug(values, chart, release_name, extra_args = '')
def debug(values, chart, image_tag)
@values = values
result = Open3.capture3("helm template --debug #{release_name} . #{extra_args} -f -",

# Set the default image tag
if image_tag
@values["image"] ||= { "tag" => image_tag }
end

result = Open3.capture3("helm template --debug optest . -f -",
chdir: File.join(__dir__, '..', 'charts', chart),
stdin_data: YAML.dump(values))
@stdout, @stderr, @exit_code = result
Expand Down

0 comments on commit 5f01a5d

Please sign in to comment.