Skip to content

Commit b940313

Browse files
committed
Update upgrade-consistency-sharded-tls tests
1 parent b40834a commit b940313

10 files changed

Lines changed: 24 additions & 22 deletions

File tree

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ MOCKGEN = $(shell pwd)/bin/mockgen
104104
mockgen: ## Download mockgen locally if necessary.
105105
$(call go-get-tool,$(MOCKGEN), github.com/golang/mock/mockgen@latest)
106106

107+
update-version:
108+
echo $(NEXT_VER) > pkg/version/version.txt
109+
107110
# Prepare release
108111
include e2e-tests/release_versions
109112
CERT_MANAGER_VER := $(shell grep -Eo "cert-manager v.*" go.mod|grep -Eo "[0-9]+\.[0-9]+\.[0-9]+")
@@ -133,8 +136,7 @@ release: manifests
133136
MAJOR_VER := $(shell grep -oE "crVersion: .*" deploy/cr.yaml|grep -oE "[0-9]+\.[0-9]+\.[0-9]+"|cut -d'.' -f1)
134137
MINOR_VER := $(shell grep -oE "crVersion: .*" deploy/cr.yaml|grep -oE "[0-9]+\.[0-9]+\.[0-9]+"|cut -d'.' -f2)
135138
NEXT_VER ?= $(MAJOR_VER).$$(($(MINOR_VER) + 1)).0
136-
after-release: manifests
137-
echo $(NEXT_VER) > pkg/version/version.txt
139+
after-release: update-version manifests
138140
$(SED) -i \
139141
-e "s/crVersion: .*/crVersion: $(NEXT_VER)/" \
140142
-e "/^spec:/,/^ image:/{s#image: .*#image: perconalab/percona-server-mongodb-operator:main-mongod8.0#}" deploy/cr-minimal.yaml

e2e-tests/functions

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ qualify_image_ref() {
2525
local ref="$1"
2626
local first="${ref%%/*}"
2727

28-
if [[ "$first" == *.* || "$first" == *:* || "$first" == "localhost" ]]; then
28+
if [[ $first == *.* || $first == *:* || $first == "localhost" ]]; then
2929
printf '%s' "$ref"
3030
return 0
3131
fi
3232

33-
if [[ "$ref" == percona/* || "$ref" == perconalab/* ]]; then
33+
if [[ $ref == percona/* || $ref == perconalab/* ]]; then
3434
printf '%s%s' "$REGISTRY_NAME_FULL" "$ref"
3535
return 0
3636
fi
@@ -44,14 +44,14 @@ qualify_image_var() {
4444
local out=""
4545
local ref
4646

47-
[[ -z "$val" ]] && return 0
47+
[[ -z $val ]] && return 0
4848

49-
if [[ "$val" == *$'\n'* ]]; then
49+
if [[ $val == *$'\n'* ]]; then
5050
while IFS= read -r ref; do
51-
[[ -z "$ref" ]] && continue
51+
[[ -z $ref ]] && continue
5252
out+=$(qualify_image_ref "$ref")
5353
out+=$'\n'
54-
done <<< "$val"
54+
done <<<"$val"
5555
out="${out%$'\n'}"
5656
printf -v "$var" '%s' "$out"
5757
return 0

e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-cfg-1230-oc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: apps/v1
22
kind: StatefulSet
33
metadata:
44
annotations: {}
5-
generation: 9
5+
generation: 8
66
labels:
77
app.kubernetes.io/component: cfg
88
app.kubernetes.io/instance: some-name

e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-cfg-1230.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: apps/v1
22
kind: StatefulSet
33
metadata:
44
annotations: {}
5-
generation: 9
5+
generation: 8
66
labels:
77
app.kubernetes.io/component: cfg
88
app.kubernetes.io/instance: some-name

e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-rs0-1230-oc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: apps/v1
22
kind: StatefulSet
33
metadata:
44
annotations: {}
5-
generation: 9
5+
generation: 8
66
labels:
77
app.kubernetes.io/component: mongod
88
app.kubernetes.io/instance: some-name

e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-rs0-1230.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: apps/v1
22
kind: StatefulSet
33
metadata:
44
annotations: {}
5-
generation: 9
5+
generation: 8
66
labels:
77
app.kubernetes.io/component: mongod
88
app.kubernetes.io/instance: some-name

e2e-tests/upgrade-consistency-sharded-tls/run

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,20 +93,20 @@ main() {
9393
sleep 20
9494
desc 'check if Pod started'
9595
wait_cluster
96-
compare_generation "7" "statefulset" "${CLUSTER}-rs0"
97-
compare_generation "7" "statefulset" "${CLUSTER}-cfg"
96+
compare_generation "6" "statefulset" "${CLUSTER}-rs0"
97+
compare_generation "6" "statefulset" "${CLUSTER}-cfg"
9898

9999
renew_certificate "some-name-ssl"
100100
sleep 20
101101
wait_cluster
102-
compare_generation "8" "statefulset" "${CLUSTER}-rs0"
103-
compare_generation "8" "statefulset" "${CLUSTER}-cfg"
102+
compare_generation "7" "statefulset" "${CLUSTER}-rs0"
103+
compare_generation "7" "statefulset" "${CLUSTER}-cfg"
104104

105105
renew_certificate "some-name-ssl-internal"
106106
sleep 20
107107
wait_cluster
108-
compare_generation "9" "statefulset" "${CLUSTER}-rs0"
109-
compare_generation "9" "statefulset" "${CLUSTER}-cfg"
108+
compare_generation "8" "statefulset" "${CLUSTER}-rs0"
109+
compare_generation "8" "statefulset" "${CLUSTER}-cfg"
110110

111111
desc 'check if service and statefulset created with expected config'
112112
compare_kubectl service/${CLUSTER}-rs0 "-1230"

e2e-tests/upgrade-sharded/run

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ esac
4141
OPERATOR_NAME='percona-server-mongodb-operator'
4242
IMAGE=$(echo "${INIT_OPERATOR_IMAGES}" | jq -r '.versions[].matrix.operator[].imagePath')
4343
# we use the starting image from the same repo so we don't need to use initImage option
44-
if [[ "${TARGET_IMAGE}" == perconalab/* || "${TARGET_IMAGE}" == */perconalab/* ]]; then
44+
if [[ ${TARGET_IMAGE} == perconalab/* || ${TARGET_IMAGE} == */perconalab/* ]]; then
4545
IMAGE="${IMAGE/percona\//perconalab\/}"
4646
fi
4747
IMAGE_MONGOD=$(echo "${INIT_OPERATOR_IMAGES}" | jq -r '.versions[].matrix.mongod[].imagePath')

e2e-tests/upgrade/run

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ OPERATOR_NAME='percona-server-mongodb-operator'
4444

4545
IMAGE=$(echo "${INIT_OPERATOR_IMAGES}" | jq -r '.versions[].matrix.operator[].imagePath')
4646
# we use the starting image from the same repo so we don't need to use initImage option
47-
if [[ "${TARGET_IMAGE}" == perconalab/* || "${TARGET_IMAGE}" == */perconalab/* ]]; then
47+
if [[ ${TARGET_IMAGE} == perconalab/* || ${TARGET_IMAGE} == */perconalab/* ]]; then
4848
IMAGE="${IMAGE/percona\//perconalab\/}"
4949
fi
5050
IMAGE_MONGOD=$(echo "${INIT_OPERATOR_IMAGES}" | jq -r '.versions[].matrix.mongod[].imagePath')

installers/olm/generate.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ update_yaml_images() {
8484
return 1
8585
fi
8686

87-
local temp_file
88-
temp_file=$(mktemp)
87+
local temp_file
88+
temp_file=$(mktemp)
8989

9090
sed -E 's/(("image":|"initImage":|containerImage:|image:|initImage:)[ ]*"?)([^"]+)("?)/\1docker.io\/\3\4/g' "$yaml_file" >"$temp_file"
9191
mv "$temp_file" "$yaml_file"

0 commit comments

Comments
 (0)