portainer / k8s

How to deploy Portainer inside a Kubernetes environment.
MIT License
83 stars 56 forks source link

fix(k8s/helm): add semantic version string check #108

Closed oscarzhou-portainer closed 2 years ago

oscarzhou-portainer commented 2 years ago

closes EE-2502

This PR will fix the below error while installing Portainer with helm chart image tag neither latest or xx.xx.xx format, such as develop and other specific branch name on internal infrastructure.

Error: template: portainer/templates/deployment.yaml:98:34: executing "portainer/templates/deployment.yaml" at <semver .Values.image.tag>: error calling semver: Invalid Semantic Version

Test cases for CE:

helm template portainer/ --set image.tag="develop"
helm template portainer/ --set image.tag="2.6.0"
helm template portainer/ --set image.tag="2.11.0"
helm template portainer/ --set image.tag="latest"

Test cases for EE:

helm template portainer/ --set enterpriseEdition.enabled=true --set enterpriseEdition.image.tag="2.7.0"
helm template portainer/ --set enterpriseEdition.enabled=true --set enterpriseEdition.image.tag="2.9.0"
helm template portainer/ --set enterpriseEdition.enabled=true --set enterpriseEdition.image.tag="develop"
helm template portainer/ --set enterpriseEdition.enabled=true --set enterpriseEdition.image.tag="latest"