Skip to content

Commit b58b089

Browse files
authored
shfmt -bn -ci -s -i 4 -w (#812)
1 parent 9a1eece commit b58b089

File tree

207 files changed

+1020
-1044
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

207 files changed

+1020
-1044
lines changed

e2e-tests/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ You need to install a number of software packages on your system to satisfy the
1414
* [assert](https://github.com/morningspace/kubeassert) kubectl plugin
1515
* [kuttl](https://kuttl.dev/) Kubernetes test framework
1616
* [gcloud](https://cloud.google.com/sdk/gcloud) - Google Cloud command-line tool (if the ability to run tests on Google Cloud is needed)
17+
* [shfmt](https://github.com/mvdan/sh) - A shell parser, formatter, and interpreter
1718

1819
### CentOS
1920

e2e-tests/format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ for f in "${@}"; do
77
echo "Formatting ${f}"
88

99
yq eval '.commands[0].script' "${f}" >"${TMP}"
10-
shfmt -bn -ci -s -w $TMP
10+
shfmt -bn -ci -s -i 4 -w $TMP
1111

1212
SHFILE=$(cat ${TMP}) yq eval '.commands[0].script=strenv(SHFILE)' --inplace "${f}"
1313
done

e2e-tests/functions

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -576,9 +576,9 @@ get_primary_from_haproxy() {
576576

577577
get_primary_from_group_replication() {
578578
run_mysql \
579-
"SELECT MEMBER_HOST FROM performance_schema.replication_group_members where MEMBER_ROLE='PRIMARY';" \
580-
"-h $(get_mysql_router_service $(get_cluster_name)) -P 6446 -uroot -proot_password" \
581-
| cut -d'.' -f1
579+
"SELECT MEMBER_HOST FROM performance_schema.replication_group_members where MEMBER_ROLE='PRIMARY';" \
580+
"-h $(get_mysql_router_service $(get_cluster_name)) -P 6446 -uroot -proot_password" \
581+
| cut -d'.' -f1
582582
}
583583

584584
verify_certificate_sans() {

e2e-tests/tests/async-ignore-annotations/01-create-cluster.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ commands:
99
source ../../functions
1010
1111
get_cr \
12-
| yq eval '.spec.mysql.clusterType="async"' - \
13-
| yq eval '.spec.mysql.expose.enabled=true' - \
14-
| yq eval '.spec.mysql.expose.type="ClusterIP"' - \
15-
| yq eval '.spec.proxy.haproxy.expose.type="ClusterIP"' - \
16-
| yq eval '.spec.orchestrator.expose.type="ClusterIP"' - \
17-
| kubectl -n "${NAMESPACE}" apply -f -
12+
| yq eval '.spec.mysql.clusterType="async"' - \
13+
| yq eval '.spec.mysql.expose.enabled=true' - \
14+
| yq eval '.spec.mysql.expose.type="ClusterIP"' - \
15+
| yq eval '.spec.proxy.haproxy.expose.type="ClusterIP"' - \
16+
| yq eval '.spec.orchestrator.expose.type="ClusterIP"' - \
17+
| kubectl -n "${NAMESPACE}" apply -f -

e2e-tests/tests/async-ignore-annotations/02-add-custom-annotations.yaml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,18 @@ commands:
1010
haproxy_svc=$(get_haproxy_svc async-ignore-annotations)
1111
orc_svc=$(get_orc_svc async-ignore-annotations)
1212
13-
kubectl get svc $mysql_svc-0 -o yaml -n "${NAMESPACE}" \
14-
| yq eval '.metadata.annotations += {"async-annotations-to-ignore-mysql": "true", "async-annotations-not-to-ignore-mysql": "true" }' - \
15-
| yq eval '.metadata.labels += {"async-labels-to-ignore-mysql": "true", "async-labels-not-to-ignore-mysql": "true"}' - \
16-
| kubectl -n "${NAMESPACE}" apply -f -
13+
kubectl get svc $mysql_svc-0 -o yaml -n "${NAMESPACE}" \
14+
| yq eval '.metadata.annotations += {"async-annotations-to-ignore-mysql": "true", "async-annotations-not-to-ignore-mysql": "true" }' - \
15+
| yq eval '.metadata.labels += {"async-labels-to-ignore-mysql": "true", "async-labels-not-to-ignore-mysql": "true"}' - \
16+
| kubectl -n "${NAMESPACE}" apply -f -
1717
18-
kubectl get svc $haproxy_svc -o yaml -n "${NAMESPACE}"\
19-
| yq eval '.metadata.annotations += {"async-annotations-to-ignore-haproxy": "true", "async-annotations-not-to-ignore-haproxy": "true" }' - \
20-
| yq eval '.metadata.labels += {"async-labels-to-ignore-haproxy": "true", "async-labels-not-to-ignore-haproxy": "true"}' - \
21-
| kubectl -n "${NAMESPACE}" apply -f -
22-
23-
kubectl get svc $orc_svc-0 -o yaml -n "${NAMESPACE}"\
24-
| yq eval '.metadata.annotations += {"async-annotations-to-ignore-orc": "true", "async-annotations-not-to-ignore-orc": "true" }' - \
25-
| yq eval '.metadata.labels += {"async-labels-to-ignore-orc": "true", "async-labels-not-to-ignore-orc": "true" }' - \
26-
| kubectl -n "${NAMESPACE}" apply -f -
18+
kubectl get svc $haproxy_svc -o yaml -n "${NAMESPACE}" \
19+
| yq eval '.metadata.annotations += {"async-annotations-to-ignore-haproxy": "true", "async-annotations-not-to-ignore-haproxy": "true" }' - \
20+
| yq eval '.metadata.labels += {"async-labels-to-ignore-haproxy": "true", "async-labels-not-to-ignore-haproxy": "true"}' - \
21+
| kubectl -n "${NAMESPACE}" apply -f -
2722
23+
kubectl get svc $orc_svc-0 -o yaml -n "${NAMESPACE}" \
24+
| yq eval '.metadata.annotations += {"async-annotations-to-ignore-orc": "true", "async-annotations-not-to-ignore-orc": "true" }' - \
25+
| yq eval '.metadata.labels += {"async-labels-to-ignore-orc": "true", "async-labels-not-to-ignore-orc": "true" }' - \
26+
| kubectl -n "${NAMESPACE}" apply -f -
2827
timeout: 100

e2e-tests/tests/async-ignore-annotations/03-add-annotations-to-ignore.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@ commands:
88
source ../../functions
99
1010
kubectl -n "${NAMESPACE}" patch ps "$(get_cluster_name)" \
11-
--type json \
12-
-p '[{"op": "add", "path": "/spec/ignoreAnnotations", "value": ["async-annotations-to-ignore-mysql","async-annotations-to-ignore-haproxy", "async-annotations-to-ignore-orc"] }]'
11+
--type json \
12+
-p '[{"op": "add", "path": "/spec/ignoreAnnotations", "value": ["async-annotations-to-ignore-mysql","async-annotations-to-ignore-haproxy", "async-annotations-to-ignore-orc"] }]'
1313
1414
kubectl -n "${NAMESPACE}" patch ps "$(get_cluster_name)" \
15-
--type json \
16-
-p '[{"op": "add", "path": "/spec/ignoreLabels", "value": ["async-labels-to-ignore-mysql","async-labels-to-ignore-haproxy","async-labels-to-ignore-orc" ] }]'
17-
15+
--type json \
16+
-p '[{"op": "add", "path": "/spec/ignoreLabels", "value": ["async-labels-to-ignore-mysql","async-labels-to-ignore-haproxy","async-labels-to-ignore-orc" ] }]'
1817
timeout: 30

e2e-tests/tests/async-ignore-annotations/04-add-annotations-to-service-via-cr.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,14 @@ commands:
88
source ../../functions
99
1010
kubectl -n "${NAMESPACE}" patch ps "$(get_cluster_name)" \
11-
--type json \
12-
-p '[{"op": "add", "path": "/spec/mysql/expose", "value": {"enabled": true, "type": ClusterIP,"annotations": {"service.beta.kubernetes.io/aws-load-balancer-backend-protocol": "http","service.beta.kubernetes.io/aws-load-balancer-backend": "test-type"}, "labels": {"rack": "rack-22","rack-test": "rack-test-22"}}}]'
11+
--type json \
12+
-p '[{"op": "add", "path": "/spec/mysql/expose", "value": {"enabled": true, "type": ClusterIP,"annotations": {"service.beta.kubernetes.io/aws-load-balancer-backend-protocol": "http","service.beta.kubernetes.io/aws-load-balancer-backend": "test-type"}, "labels": {"rack": "rack-22","rack-test": "rack-test-22"}}}]'
1313
1414
kubectl -n "${NAMESPACE}" patch ps "$(get_cluster_name)" \
15-
--type json \
16-
-p '[{"op": "add", "path": "/spec/proxy/haproxy/expose", "value": {"type": ClusterIP ,"annotations": {"service.beta.kubernetes.io/aws-load-balancer-backend-protocol": "http","service.beta.kubernetes.io/aws-load-balancer-backend": "test-type"}, "labels": {"rack": "rack-22","rack-test": "rack-test-22"}}}]'
15+
--type json \
16+
-p '[{"op": "add", "path": "/spec/proxy/haproxy/expose", "value": {"type": ClusterIP ,"annotations": {"service.beta.kubernetes.io/aws-load-balancer-backend-protocol": "http","service.beta.kubernetes.io/aws-load-balancer-backend": "test-type"}, "labels": {"rack": "rack-22","rack-test": "rack-test-22"}}}]'
1717
1818
kubectl -n "${NAMESPACE}" patch ps "$(get_cluster_name)" \
19-
--type json \
20-
-p '[{"op": "add", "path": "/spec/orchestrator/expose", "value": {"type": ClusterIP ,"annotations": {"service.beta.kubernetes.io/aws-load-balancer-backend-protocol": "http","service.beta.kubernetes.io/aws-load-balancer-backend": "test-type"}, "labels": {"rack": "rack-22","rack-test": "rack-test-22"}}}]'
21-
19+
--type json \
20+
-p '[{"op": "add", "path": "/spec/orchestrator/expose", "value": {"type": ClusterIP ,"annotations": {"service.beta.kubernetes.io/aws-load-balancer-backend-protocol": "http","service.beta.kubernetes.io/aws-load-balancer-backend": "test-type"}, "labels": {"rack": "rack-22","rack-test": "rack-test-22"}}}]'
2221
timeout: 30

e2e-tests/tests/async-ignore-annotations/05-delete-annotations.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,14 @@ commands:
88
source ../../functions
99
1010
kubectl -n "${NAMESPACE}" patch ps "$(get_cluster_name)" \
11-
--type json \
12-
-p '[{"op": "replace", "path": "/spec/mysql/expose", "value": {"enabled": true, "type": ClusterIP,"annotations": {"service.beta.kubernetes.io/aws-load-balancer-backend-protocol": "http"}, "labels": {"rack": "rack-22"}}}]'
11+
--type json \
12+
-p '[{"op": "replace", "path": "/spec/mysql/expose", "value": {"enabled": true, "type": ClusterIP,"annotations": {"service.beta.kubernetes.io/aws-load-balancer-backend-protocol": "http"}, "labels": {"rack": "rack-22"}}}]'
1313
1414
kubectl -n "${NAMESPACE}" patch ps "$(get_cluster_name)" \
15-
--type json \
16-
-p '[{"op": "replace", "path": "/spec/proxy/haproxy/expose", "value": {"type": ClusterIP ,"annotations": {"service.beta.kubernetes.io/aws-load-balancer-backend-protocol": "http"}, "labels": {"rack": "rack-22"}}}]'
15+
--type json \
16+
-p '[{"op": "replace", "path": "/spec/proxy/haproxy/expose", "value": {"type": ClusterIP ,"annotations": {"service.beta.kubernetes.io/aws-load-balancer-backend-protocol": "http"}, "labels": {"rack": "rack-22"}}}]'
1717
1818
kubectl -n "${NAMESPACE}" patch ps "$(get_cluster_name)" \
19-
--type json \
20-
-p '[{"op": "replace", "path": "/spec/orchestrator/expose", "value": {"type": ClusterIP ,"annotations": {"service.beta.kubernetes.io/aws-load-balancer-backend-protocol": "http"}, "labels": {"rack": "rack-22"}}}]'
21-
19+
--type json \
20+
-p '[{"op": "replace", "path": "/spec/orchestrator/expose", "value": {"type": ClusterIP ,"annotations": {"service.beta.kubernetes.io/aws-load-balancer-backend-protocol": "http"}, "labels": {"rack": "rack-22"}}}]'
2221
timeout: 30

e2e-tests/tests/async-ignore-annotations/06-update-annotation.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,14 @@ commands:
88
source ../../functions
99
1010
kubectl -n "${NAMESPACE}" patch ps "$(get_cluster_name)" \
11-
--type json \
12-
-p '[{"op": "replace", "path": "/spec/mysql/expose", "value": {"enabled": true, "type": ClusterIP,"annotations": {"service.beta.kubernetes.io/aws-load-balancer-backend-protocol": "http-test"}, "labels": {"rack": "rack-22-test"}}}]'
11+
--type json \
12+
-p '[{"op": "replace", "path": "/spec/mysql/expose", "value": {"enabled": true, "type": ClusterIP,"annotations": {"service.beta.kubernetes.io/aws-load-balancer-backend-protocol": "http-test"}, "labels": {"rack": "rack-22-test"}}}]'
1313
1414
kubectl -n "${NAMESPACE}" patch ps "$(get_cluster_name)" \
15-
--type json \
16-
-p '[{"op": "replace", "path": "/spec/proxy/haproxy/expose", "value": {"type": ClusterIP ,"annotations": {"service.beta.kubernetes.io/aws-load-balancer-backend-protocol": "http-test"}, "labels": {"rack": "rack-22-test"}}}]'
15+
--type json \
16+
-p '[{"op": "replace", "path": "/spec/proxy/haproxy/expose", "value": {"type": ClusterIP ,"annotations": {"service.beta.kubernetes.io/aws-load-balancer-backend-protocol": "http-test"}, "labels": {"rack": "rack-22-test"}}}]'
1717
1818
kubectl -n "${NAMESPACE}" patch ps "$(get_cluster_name)" \
19-
--type json \
20-
-p '[{"op": "replace", "path": "/spec/orchestrator/expose", "value": {"type": ClusterIP ,"annotations": {"service.beta.kubernetes.io/aws-load-balancer-backend-protocol": "http-test"}, "labels": {"rack": "rack-22-test"}}}]'
21-
19+
--type json \
20+
-p '[{"op": "replace", "path": "/spec/orchestrator/expose", "value": {"type": ClusterIP ,"annotations": {"service.beta.kubernetes.io/aws-load-balancer-backend-protocol": "http-test"}, "labels": {"rack": "rack-22-test"}}}]'
2221
timeout: 30

e2e-tests/tests/async-ignore-annotations/07-delete-custom-annotations-from-ignore.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@ commands:
88
source ../../functions
99
1010
kubectl -n "${NAMESPACE}" patch ps "$(get_cluster_name)" \
11-
--type json \
12-
-p '[{"op": "replace", "path": "/spec/ignoreAnnotations", "value": [] }]'
11+
--type json \
12+
-p '[{"op": "replace", "path": "/spec/ignoreAnnotations", "value": [] }]'
1313
1414
kubectl -n "${NAMESPACE}" patch ps "$(get_cluster_name)" \
15-
--type json \
16-
-p '[{"op": "replace", "path": "/spec/ignoreLabels", "value": [] }]'
17-
15+
--type json \
16+
-p '[{"op": "replace", "path": "/spec/ignoreLabels", "value": [] }]'
1817
timeout: 30

0 commit comments

Comments
 (0)