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

chore: fix pulsar addon typo #1115

Merged
merged 5 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
12 changes: 0 additions & 12 deletions addons/pulsar/scripts-ut-spec/init_broker_spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,6 @@ Describe "Pulsar Init Broker Bash Script Tests"
return 0
}

quit_script() {
return 0
}

When run init_broker
The status should be success
End
Expand All @@ -158,10 +154,6 @@ Describe "Pulsar Init Broker Bash Script Tests"
return 0
}

quit_script() {
return 0
}

python3() {
return 0
}
Expand Down Expand Up @@ -198,10 +190,6 @@ Describe "Pulsar Init Broker Bash Script Tests"
return 0
}

quit_script() {
return 0
}

When run init_broker
The stdout should include "Initializing cluster metadata for cluster: my-cluster"
The status should be success
Expand Down
9 changes: 2 additions & 7 deletions addons/pulsar/scripts/init-broker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,14 @@ init_broker() {
local idx=${POD_NAME##*-}
if [ $idx -ne 0 ]; then
wait_for_cluster_metadata "$zookeeperServers" "$clusterName"
echo "Cluster already initialized" && quit_script
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to && exit 0 to keep the semantic.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to && exit 0 to keep the semantic.

fixed done

echo "Waiting for cluster initialize ready."
fi

if check_cluster_initialized "$zookeeperServers" "$clusterName"; then
echo "Cluster already initialized" && quit_script
echo "Cluster already initialized"
fi

initialize_cluster_metadata "$clusterName" "$zookeeperServers" "$webServiceUrl" "$brokerServiceUrl"
quit_script
}

quit_script() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function still appears in the file (a few lines above).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function still appears in the file (a few lines above).

fixed done

(curl -sf -XPOST http://127.0.0.1:15020/quitquitquit || true) && exit 0
}

# This is magic for shellspec ut framework.
Expand Down
1 change: 1 addition & 0 deletions addons/pulsar/scripts/start-bookies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ start_bookies() {
fi

OPTS="${OPTS} -Dlog4j2.formatMsgNoLookups=true"
export OPTS
exec bin/pulsar bookie
}

Expand Down
18 changes: 9 additions & 9 deletions addons/pulsar/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -91,21 +91,21 @@ Generate major version of cluster
{{- end }}

{{/*
Define pulsar bookies reovery component definition regex pattern
Define pulsar bookies recovery component definition regex pattern
*/}}
{{- define "pulsar.bkRecoveryCmpdRegexPattern" -}}
^pulsar-bookies-recovery-
{{- end -}}

{{/*
Define pulsar v3.X bookies reovery component definition name
Define pulsar v3.X bookies recovery component definition name
*/}}
{{- define "pulsar3.bkRecoveryCmpdName" -}}
pulsar-bookies-recovery-3-{{ .Chart.Version }}
{{- end -}}

{{/*
Define pulsar v2.X bookies reovery component definition name
Define pulsar v2.X bookies recovery component definition name
*/}}
{{- define "pulsar2.bkRecoveryCmpdName" -}}
pulsar-bookies-recovery-2-{{ .Chart.Version }}
Expand Down Expand Up @@ -154,7 +154,7 @@ Define pulsar v3.X broker component definition regex pattern
{{- end -}}

{{/*
Define pulsar v2.X bookies reovery component definition name
Define pulsar v2.X broker component definition name
*/}}
{{- define "pulsar2.brokerCmpdName" -}}
pulsar-broker-2-{{ .Chart.Version }}
Expand Down Expand Up @@ -182,7 +182,7 @@ pulsar-proxy-3-{{ .Chart.Version }}
{{- end -}}

{{/*
Define pulsar v2.X bookies reovery component definition name
Define pulsar v2.X proxy component definition name
*/}}
{{- define "pulsar2.proxyCmpdName" -}}
pulsar-proxy-2-{{ .Chart.Version }}
Expand Down Expand Up @@ -266,28 +266,28 @@ pulsar-env-constraints
{{- end -}}

{{/*
Define pulsar v3.X bookies recovery config tpl name
Define pulsar v3.X bookies config tpl name
*/}}
{{- define "pulsar3.bookiesConfigTplName" -}}
pulsar3-bookies-config-tpl
{{- end -}}

{{/*
Define pulsar v2.X bookies recovery config tpl name
Define pulsar v2.X bookies config tpl name
*/}}
{{- define "pulsar2.bookiesConfigTplName" -}}
pulsar2-bookies-config-tpl
{{- end -}}

{{/*
Define pulsar v3.X bookies recovery config constraint name
Define pulsar v3.X bookies config constraint name
*/}}
{{- define "pulsar3.bookiesConfigConstraintName" -}}
pulsar3-bookies-config-constraint
{{- end -}}

{{/*
Define pulsar v2.X bookies recovery config constraint name
Define pulsar v2.X bookies config constraint name
*/}}
{{- define "pulsar2.bookiesConfigConstraintName" -}}
pulsar2-bookies-config-constraint
Expand Down
Loading