Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: scripts #4291

Merged
merged 9 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions charts/kube-ovn/templates/central-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ spec:
image: {{ .Values.global.registry.address }}/{{ .Values.global.images.kubeovn.repository }}:{{ .Values.global.images.kubeovn.tag }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
command:
- bash
zhangzujian marked this conversation as resolved.
Show resolved Hide resolved
- /kube-ovn/start-db.sh
securityContext:
runAsUser: 0
Expand Down
1 change: 1 addition & 0 deletions dist/images/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3418,6 +3418,7 @@ spec:
image: "$REGISTRY/kube-ovn:$VERSION"
imagePullPolicy: $IMAGE_PULL_POLICY
command:
- bash
- /kube-ovn/start-db.sh
securityContext:
runAsUser: 0
Expand Down
12 changes: 7 additions & 5 deletions dist/images/start-db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ SB_CLUSTER_PORT=${SB_CLUSTER_PORT:-6644}
ENABLE_SSL=${ENABLE_SSL:-false}
ENABLE_BIND_LOCAL_IP=${ENABLE_BIND_LOCAL_IP:-false}

echo "ENABLE_SSL is set to $ENABLE_SSL"
echo "ENABLE_BIND_LOCAL_IP is set to $ENABLE_BIND_LOCAL_IP"

DB_ADDR=::
DB_ADDRESSES=::
if [[ $ENABLE_BIND_LOCAL_IP == "true" ]]; then
Expand All @@ -49,11 +52,9 @@ if [[ $ENABLE_BIND_LOCAL_IP == "true" ]]; then
fi

SSL_OPTIONS=
function ssl_options() {
if "$ENABLE_SSL" != "false" ]; then
SSL_OPTIONS="-p /var/run/tls/key -c /var/run/tls/cert -C /var/run/tls/cacert"
fi
}
if [ "$ENABLE_SSL" != "false" ]; then
SSL_OPTIONS="-p /var/run/tls/key -c /var/run/tls/cert -C /var/run/tls/cacert"
fi

. /usr/share/openvswitch/scripts/ovs-lib || exit 1

Expand Down Expand Up @@ -139,6 +140,7 @@ function is_clustered {
function set_nb_version_compatibility() {
if [ -n "$OVN_VERSION_COMPATIBILITY" ]; then
if ! ovn-nbctl --db=$(gen_conn_str 6641) $SSL_OPTIONS get NB_Global . options | grep -q version_compatibility=; then
echo "setting ovn NB_Global option version_compatibility to ${OVN_VERSION_COMPATIBILITY}"
ovn-nbctl --db=$(gen_conn_str 6641) $SSL_OPTIONS set NB_Global . options:version_compatibility=${OVN_VERSION_COMPATIBILITY}
return
fi
Expand Down
10 changes: 4 additions & 6 deletions dist/images/upgrade-ovs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ OVN_VERSION_COMPATIBILITY=${OVN_VERSION_COMPATIBILITY:-}
UPDATE_STRATEGY=`kubectl -n kube-system get ds ovs-ovn -o jsonpath='{.spec.updateStrategy.type}'`

SSL_OPTIONS=
function ssl_options() {
if "$ENABLE_SSL" != "false" ]; then
SSL_OPTIONS="-p /var/run/tls/key -c /var/run/tls/cert -C /var/run/tls/cacert"
fi
}
if [ "$ENABLE_SSL" != "false" ]; then
SSL_OPTIONS="-p /var/run/tls/key -c /var/run/tls/cert -C /var/run/tls/cacert"
fi

function gen_conn_str {
if [[ -z "${OVN_DB_IPS}" ]]; then
Expand All @@ -38,7 +36,7 @@ nb_addr="$(gen_conn_str 6641)"
while true; do
if [ x`ovn-nbctl --db=$nb_addr $SSL_OPTIONS get NB_Global . options | grep -o 'version_compatibility='` != "x" ]; then
value=`ovn-nbctl --db=$nb_addr $SSL_OPTIONS get NB_Global . options:version_compatibility | sed -e 's/^"//' -e 's/"$//'`
echo "ovn NB_Global option version_compatibility is set to $value"
echo "ovn NB_Global option version_compatibility is already set to $value"
if [ "$value" = "$OVN_VERSION_COMPATIBILITY" -o "$value" = "_$OVN_VERSION_COMPATIBILITY" ]; then
break
fi
Expand Down
Loading