Skip to content

Commit 7679520

Browse files
author
Rodrigo Valin
authored
Release MongoDB Kubernetes Operator v0.7.2 (#780)
1 parent b175000 commit 7679520

File tree

7 files changed

+51
-23
lines changed

7 files changed

+51
-23
lines changed

config/manager/manager.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ spec:
5454
value: mongo
5555
- name: MONGODB_REPO_URL
5656
value: docker.io
57-
image: quay.io/mongodb/mongodb-kubernetes-operator:0.7.1
57+
image: quay.io/mongodb/mongodb-kubernetes-operator:0.7.2
5858
imagePullPolicy: Always
5959
name: mongodb-kubernetes-operator
6060
resources:

deploy/openshift/operator_openshift.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ spec:
5656
value: mongo
5757
- name: MONGODB_REPO_URL
5858
value: docker.io
59-
image: quay.io/mongodb/mongodb-kubernetes-operator:0.7.1
59+
image: quay.io/mongodb/mongodb-kubernetes-operator:0.7.2
6060
imagePullPolicy: Always
6161
name: mongodb-kubernetes-operator
6262
resources:

docs/RELEASE_NOTES.md

+6-11
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,18 @@
1-
# MongoDB Kubernetes Operator 0.7.1
1+
# MongoDB Kubernetes Operator 0.7.2
22

33
## Kubernetes Operator
44

5-
- Changes
6-
- MongoDB database of the statefulSet is managed using distinct Role, ServiceAccount and RoleBinding.
7-
- TLS Secret can also contain a single "tls.pem" entry, containing the concatenation of the certificate and key
8-
- If a TLS secret contains all of "tls.key", "tls.crt" and "tls.pem" entries, the operator will raise an error if the "tls.pem" one is not equal to the concatenation of "tls.crt" with "tls.key"
9-
- Readinessprobe reports MongoDB running as Arbitrer as _Running_ & _Healthy_.
10-
- The `CLUSTER_DOMAIN` environment variable can be set on the Operator Pod, to configure the Kubernetes cluster's Domain,
11-
in case this one differs from the default `cluster.local`.
5+
- Bug fixes
6+
- Adds missing roles for Database Pods.
7+
- Fixes OpenShift install.
128

139
## MongoDBCommunity Resource
14-
* Changes
15-
* Specifying `spec.additionalMongodConfig.storage.dbPath` will now be respected correctly.
10+
* No changes
1611

1712

1813
## Updated Image Tags
1914

20-
- mongodb-kubernetes-operator:0.7.1
15+
- mongodb-kubernetes-operator:0.7.2
2116

2217
_All the images can be found in:_
2318

docs/how-to-release.md

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* Update any changing versions in [release.json](../release.json).
66
* Ensure that [the release notes](./RELEASE_NOTES.md) are up to date for this release.
77
* Run `python scripts/ci/update_release.py` to update the relevant yaml manifests.
8+
* Copy `CRD`s to Helm Chart
9+
- `cp config/crd/bases/mongodbcommunity.mongodb.com_mongodbcommunity.yaml helm-charts/charts/community-operator-crds/templates/mongodbcommunity.mongodb.com_mongodbcommunity.yaml`
810
* Commit all changes.
911
* Create a PR with the title `Release MongoDB Kubernetes Operator v<operator-version>` (the title must match this pattern)
1012

helm-charts

Submodule helm-charts updated 53 files

release.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"mongodb-kubernetes-operator": "0.7.1",
2+
"mongodb-kubernetes-operator": "0.7.2",
33
"version-upgrade-hook": "1.0.3",
44
"readiness-probe": "1.0.6",
55
"mongodb-agent": {

scripts/ci/update_release.py

+39-8
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,34 @@
22

33
import json
44
import sys
5-
import yaml
6-
from typing import Dict
5+
from typing import Dict, Callable
6+
7+
import ruamel.yaml
8+
9+
yaml = ruamel.yaml.YAML()
10+
711

812
RELATIVE_PATH_TO_MANAGER_YAML = "config/manager/manager.yaml"
913
RELATIVE_PATH_TO_OPENSHIFT_MANAGER_YAML = "deploy/openshift/operator_openshift.yaml"
1014

15+
RELATIVE_PATH_TO_CHART_VALUES = "helm-charts/charts/community-operator/values.yaml"
16+
RELATIVE_PATH_TO_CHART = "helm-charts/charts/community-operator/Chart.yaml"
17+
1118

1219
def _load_yaml_file(path: str) -> Dict:
1320
with open(path, "r") as f:
14-
return yaml.safe_load(f.read())
21+
return yaml.load(f.read())
1522

1623

1724
def _dump_yaml(operator: Dict, path: str) -> None:
1825
with open(path, "w+") as f:
1926
yaml.dump(operator, f)
2027

2128

22-
def update_and_write_file(path: str) -> None:
29+
def update_and_write_file(path: str, update_function: Callable) -> None:
2330
release = _load_release()
2431
yaml_file = _load_yaml_file(path)
25-
_update_operator_deployment(yaml_file, release)
32+
update_function(yaml_file, release)
2633
_dump_yaml(yaml_file, path)
2734

2835

@@ -36,7 +43,7 @@ def _replace_tag(image: str, new_tag: str) -> str:
3643
return split_image[0] + ":" + new_tag
3744

3845

39-
def _update_operator_deployment(operator_deployment: Dict, release: Dict) -> None:
46+
def update_operator_deployment(operator_deployment: Dict, release: Dict) -> None:
4047
operator_container = operator_deployment["spec"]["template"]["spec"]["containers"][
4148
0
4249
]
@@ -55,9 +62,33 @@ def _update_operator_deployment(operator_deployment: Dict, release: Dict) -> Non
5562
)
5663

5764

65+
def update_chart_values(values: Dict, release: Dict) -> None:
66+
values["agent"]["version"] = release["mongodb-agent"]["version"]
67+
values["versionUpgradeHook"]["version"] = release["version-upgrade-hook"]
68+
values["readinessProbe"]["version"] = release["readiness-probe"]
69+
values["operator"]["version"] = release["mongodb-kubernetes-operator"]
70+
71+
72+
def update_chart(chart: Dict, release: Dict) -> None:
73+
chart["version"] = release["mongodb-kubernetes-operator"]
74+
chart["appVersion"] = release["mongodb-kubernetes-operator"]
75+
76+
for dependency in chart["dependencies"]:
77+
if dependency["name"] == "community-operator-crds":
78+
dependency["version"] = release["mongodb-kubernetes-operator"]
79+
80+
5881
def main() -> int:
59-
update_and_write_file(RELATIVE_PATH_TO_MANAGER_YAML)
60-
update_and_write_file(RELATIVE_PATH_TO_OPENSHIFT_MANAGER_YAML)
82+
# Updating local files
83+
update_and_write_file(RELATIVE_PATH_TO_MANAGER_YAML, update_operator_deployment)
84+
update_and_write_file(
85+
RELATIVE_PATH_TO_OPENSHIFT_MANAGER_YAML, update_operator_deployment
86+
)
87+
88+
# Updating Helm Chart files
89+
update_and_write_file(RELATIVE_PATH_TO_CHART_VALUES, update_chart_values)
90+
update_and_write_file(RELATIVE_PATH_TO_CHART, update_chart)
91+
6192
return 0
6293

6394

0 commit comments

Comments
 (0)