mattermost / mattermost-helm

Mattermost Helm charts for Kubernetes
Apache License 2.0
165 stars 148 forks source link

Bump CRD's #295

Closed patatman closed 2 years ago

patatman commented 2 years ago

Summary

This bumps the CRD's to the latest version of the operator. I had some missing settings and config during install of the Helm chart.

Ticket Link

mattermod commented 2 years ago

Hello @patatman,

Thanks for your pull request! A Core Committer will review your pull request soon. For code contributions, you can learn more about the review process here.

patatman commented 2 years ago

One thing I did notice, I see a Kustomize file in the original operator repo. Is this used in the files in any way? I could only find a reference in the makefile, but not inside the CRD's itself.

Just double-checking.

Szymongib commented 2 years ago

One thing I did notice, I see a Kustomize file in the original operator repo. Is this used in the files in any way? I could only find a reference in the makefile, but not inside the CRD's itself.

It is not used for CRDs only to create full installation yaml.

patatman commented 2 years ago

I just noticed i'm getting an error when running Helm upgrade with this newer version:

Error: UPGRADE FAILED: cannot patch "mattermost-operator" with kind Deployment: Deployment.apps "mattermost-operator" is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{"app.kubernetes.io/instance":"mattermost-operator", "app.kubernetes.io/managed-by":"Helm", "app.kubernetes.io/name":"mattermost-operator", "helm.sh/chart":"mattermost-operator-0.2.2", "name":"mattermost-operator"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: field is immutable
Szymongib commented 2 years ago

It looks like we are using helm.sh/chart in a selector, which is immutable. The value is using chart version so changing it produces an error https://github.com/mattermost/mattermost-helm/blob/master/charts/mattermost-operator/templates/mattermost-operator/deployment.yaml#L17.

We will have to clean up the selector in the deployment as this will cause issues every time we bump the chart version. I think we can do it separately tho.

For now, you will have to recreate the deployment when doing the Helm upgrade.