Skip to content

Commit

Permalink
Merge branch 'release/v8.0.33-4' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
meiserloh authored and cesmarvin committed Jun 10, 2024
2 parents 2ebce22 + 18b78af commit 7c712c0
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [v8.0.33-4] - 2024-06-10
### Changed
- [#19] Move state that should be persistent between restarts to local config.

## [v8.0.33-3] - 2024-04-09
### Fixed
- Fixed CVE-2023-25775 CVE-2023-5178
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM registry.cloudogu.com/official/base-debian:11.6-1
FROM registry.cloudogu.com/official/base-debian:11.8-2

LABEL MAINTAINER="[email protected]" \
NAME="official/mysql" \
VERSION="8.0.33-3"
VERSION="8.0.33-4"

ENV PATH="${PATH}:/var/lib/mysql/bin" \
MYSQL_VOLUME=/var/lib/mysql \
Expand Down
3 changes: 2 additions & 1 deletion batsTests/post-upgrade.bats
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ teardown() {

run run_postupgrade "5.7.37-1" "8.0.32-1"

assert_equal "$(mock_get_call_num "${doguctl}")" "1"
assert_equal "$(mock_get_call_num "${doguctl}")" "2"
assert_equal "$(mock_get_call_args "${doguctl}" "1")" 'state upgrade done'
assert_equal "$(mock_get_call_args "${doguctl}" "2")" 'config --rm local_state'
assert_success
}
6 changes: 3 additions & 3 deletions batsTests/pre-upgrade.bats
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ teardown() {
run run_preupgrade "5.7.37-1" "8.0.32-1"

assert_equal "$(mock_get_call_num "${doguctl}")" "1"
assert_equal "$(mock_get_call_args "${doguctl}" "1")" 'state upgrading'
assert_equal "$(mock_get_call_args "${doguctl}" "1")" 'config local_state upgrading'
assert_failure
assert_equal "${status}" 123
}
Expand All @@ -62,7 +62,7 @@ teardown() {
run run_preupgrade "5.7.37-1" "5.7.37-4"

assert_equal "$(mock_get_call_num "${doguctl}")" "1"
assert_equal "$(mock_get_call_args "${doguctl}" "1")" 'state upgrading'
assert_equal "$(mock_get_call_args "${doguctl}" "1")" 'config local_state upgrading'
assert_success
}

Expand All @@ -77,7 +77,7 @@ teardown() {
run run_preupgrade "8.0.32-1" "8.0.32-4"

assert_equal "$(mock_get_call_num "${doguctl}")" "1"
assert_equal "$(mock_get_call_args "${doguctl}" "1")" 'state upgrading'
assert_equal "$(mock_get_call_args "${doguctl}" "1")" 'config local_state upgrading'
assert_success
}

Expand Down
5 changes: 3 additions & 2 deletions batsTests/startup.bats
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,13 @@ teardown() {
assert_equal "$(mock_get_call_num "${runuser}")" "1"
assert_equal "$(mock_get_call_args "${doguctl}" "1")" "config container_config/memory_limit -d empty"
assert_equal "$(mock_get_call_args "${doguctl}" "2")" "template /workspace/resources/default-config.cnf.tpl /workspace/resources/etc/my.cnf.dogu.d/default-config.cnf"
assert_equal "$(mock_get_call_args "${doguctl}" "3")" "state"
assert_equal "$(mock_get_call_args "${doguctl}" "3")" "config local_state -d empty"
assert_equal "$(mock_get_call_args "${doguctl}" "4")" "config first_start_done --default NO"
assert_equal "$(mock_get_call_args "${doguctl}" "5")" "config first_start_done YES"
assert_equal "$(mock_get_call_args "${doguctl}" "6")" "config --default WARN logging/root"
assert_equal "$(mock_get_call_args "${doguctl}" "7")" "state ready"
assert_equal "$(mock_get_call_num "${doguctl}")" "7"
assert_equal "$(mock_get_call_args "${doguctl}" "8")" "config --rm local_state"
assert_equal "$(mock_get_call_num "${doguctl}")" "8"
}

@test "applySecurityConfiguration" {
Expand Down
9 changes: 8 additions & 1 deletion dogu.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Name": "official/mysql",
"Version": "8.0.33-3",
"Version": "8.0.33-4",
"DisplayName": "MySQL",
"Description": "MySQL - Relational database",
"Url": "https://www.mysql.com/",
Expand All @@ -17,6 +17,13 @@
"Path": "/var/lib/mysql/",
"Owner": "101",
"Group": "101"
},
{
"Name": "localConfig",
"Path": "/var/ces/config",
"Owner": "1000",
"Group": "1000",
"NeedsBackup": true
}
],
"ExposedCommands": [
Expand Down
1 change: 1 addition & 0 deletions resources/post-upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ function run_postupgrade() {

echo "Set registry flag so startup script can start afterwards..."
doguctl state "upgrade done"
doguctl config --rm "local_state"

echo "Mysql post-upgrade done"
}
Expand Down
2 changes: 1 addition & 1 deletion resources/pre-upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function run_preupgrade() {
fi

echo "Set registry flag so startup script waits for post-upgrade to finish..."
doguctl state "upgrading"
doguctl config "local_state" "upgrading"

if versionXLessThanY "${FROM_VERSION}" "8.0.32-1" && versionXLessOrEqualThanY "8.0.32-1" "${TO_VERSION}"; then
dumpData
Expand Down
2 changes: 1 addition & 1 deletion resources/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function runMain() {
removeSocketIfExists
renderConfigFile

while [[ "$(doguctl state)" == "upgrading" ]]; do
while [[ "$(doguctl config "local_state" -d "empty")" == "upgrading" ]]; do
echo "Upgrade script is running. Waiting..."
sleep 3
done
Expand Down
1 change: 1 addition & 0 deletions resources/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ function startMysql() {
echo "Starting mysql..."
setDoguLogLevel
doguctl state "ready"
doguctl config --rm "local_state"
runuser -u mysql -- mysqld --datadir="${MYSQL_VOLUME}" --log_error_verbosity=${DOGU_LOGLEVEL}
}

Expand Down

0 comments on commit 7c712c0

Please sign in to comment.