How to Sync with Upstream💣
Since the mattermost operator chart is built and maintained by Big Bang syncing with upstream is not as straight forward as a kpt pkg update.
-
Run
kpt pkg update docs/upstream@{NEW OPERATOR TAG}. Notice that this updates the folderdocs/upstream. -
Incrementally copy the CRD sections from
docs/upstream/mattermost-operator.yamlinto their respective files inchart/mattermost-operator-crds/templates(it can be helpful to search for---to find the sections). At this step the following file names to match the CRD names are:clusterinstallations.mattermost.com,mattermostrestoredbs.mattermost.com, andmattermosts.installation.mattermost.com. -
Modify each CRD file to remove
creationTimestamp: nulland add labels. Labels to add:
labels:
app.kubernetes.io/managed-by: "{{ .Release.Service }}"
app.kubernetes.io/instance: "{{ .Release.Name }}"
app.kubernetes.io/version: "{{ .Chart.AppVersion }}"
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
-
Update
chart/mattermost-operator-crds/Chart.yamlversionandappVersionto the new operator version. -
Update the versions for
chart/Chart.yamlto the new operator version (version,appVersion, and dependencyversion). -
Run
helm dependency update ./chartand validate that the new CRD chart tgz is underchart/charts. -
Incrementally copy out the remaining sections from
docs/upstream/mattermost-operator.yamlinto their respective files inchart/templates. At this step the following file names to match the object types are:clusterrole,clusterrolebinding,service,serviceaccount, anddeployment. -
Modify each to add labels and remove
creationTimestamp: null. Any spot wherenamespace:if referenced should become{{ .Release.Namespace }}instead of hardcodedmattermost-operator. As before, the labels to add:
labels:
app.kubernetes.io/managed-by: "{{ .Release.Service }}"
app.kubernetes.io/instance: "{{ .Release.Name }}"
app.kubernetes.io/version: "{{ .Chart.AppVersion }}"
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
-
For the deployment file: make sure that you maintain the existing values mapping for
replicas,image,resources,imagePullSecrets,securityContext,nodeSelector,affinity, andtolerations. These are all BigBang additions that we need to keep. -
Modify
chart/values.yamlto use the latest image underimage.tag. -
Add a changelog entry for the Chart version.
-
Update top-level ./README.md using script from gluon library.
-
Open an MR on Repo1 and validate that all changes look as expected in the diffs and CI passes. Make any necessary changes if something looks off or CI fails.