Skip to content

Commit

Permalink
Merge pull request #58 from sclorg/mysql_migration_deployment
Browse files Browse the repository at this point in the history
Mysql migration deployment
  • Loading branch information
phracek authored Dec 11, 2023
2 parents cbdff45 + e6c0ba6 commit 4223ae5
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 22 deletions.
4 changes: 2 additions & 2 deletions charts/redhat/mysql-persistent/src/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ description: |-
NOTE: Scaling to more than one replica is not supported. You must have persistent volumes available in your cluster to use this template.
name: mysql-persistent
tags: database,mysql
version: 0.0.2
version: 0.0.3
annotations:
charts.openshift.io/name: Red Hat MySQL database service, with persistent storage (experimental).
apiVersion: v2
appVersion: 0.0.2
appVersion: 0.0.3
kubeVersion: '>=1.20.0'
sources:
- https://github.com/sclorg/helm-charts
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
template.alpha.openshift.io/wait-for-ready: "true"
image.openshift.io/triggers: |-
[
{
"from": {
"kind": "ImageStreamTag",
"name": "mysql:{{ .Values.mysql_version }}"
},
"fieldPath": "spec.template.spec.containers[0].image"
}
]
labels:
template: mysql-persistent-template
name: {{ .Values.database_service_name }}
spec:
replicas: 1
selector:
name: {{ .Values.database_service_name }}
matchLabels:
name: {{ .Values.database_service_name }}
strategy:
type: Recreate
template:
Expand Down Expand Up @@ -39,7 +50,7 @@ spec:
secretKeyRef:
key: database-name
name: {{ .Values.database_service_name }}
image: "mysql:{{ .Values.mysql_version }}"
image: " "
imagePullPolicy: IfNotPresent
livenessProbe:
exec:
Expand Down Expand Up @@ -72,14 +83,3 @@ spec:
- name: {{ .Values.database_service_name }}-data
persistentVolumeClaim:
claimName: {{ .Values.database_service_name }}
triggers:
- imageChangeParams:
automatic: true
containerNames:
- mysql
from:
kind: ImageStreamTag
name: mysql:{{ .Values.mysql_version }}
namespace: {{ .Values.namespace }}
type: ImageChange
- type: ConfigChange
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ spec:
value: "{{ .Values.mysql_database }}"
command:
- /bin/bash
- -ec
- "echo \"SELECT 42 as testval\\g\" | mysql --connect-timeout=15 -h {{ .Values.database_service_name }} $MARIADB_DATABASE -u$MARIADB_USER -p$MARIADB_PASSWORD"
- -exc
- "echo \"SELECT 42 as testval\\g\" | mysql --connect-timeout=15 -h {{ .Values.database_service_name }} $MARIADB_DATABASE -u $MARIADB_USER -p$MARIADB_PASSWORD"
restartPolicy: Never
Binary file added mysql-persistent-0.0.3.tgz
Binary file not shown.
1 change: 0 additions & 1 deletion tests/test_mysql_imagestreams.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ def teardown_method(self):
],
)
def test_package_imagestream(self, version, registry):
self.hc_api.set_version("0.0.1")
self.hc_api.helm_package()
self.hc_api.helm_installation()
assert self.hc_api.check_imagestreams(version=version, registry=registry)
Expand Down
2 changes: 0 additions & 2 deletions tests/test_mysql_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ def teardown_method(self):
self.hc_api.delete_project()

def test_package_persistent(self):
self.hc_api.set_version("0.0.1")
self.hc_api.package_name = "mysql-imagestreams"
self.hc_api.helm_package()
assert self.hc_api.helm_installation()
self.hc_api.set_version("0.0.2")
self.hc_api.package_name = "mysql-persistent"
self.hc_api.helm_package()
assert self.hc_api.helm_installation(values={".mysql_version": "8.0-el8", ".namespace": self.hc_api.namespace})
Expand Down

0 comments on commit 4223ae5

Please sign in to comment.