Skip to content

Commit

Permalink
Allow initialization to be set (#53)
Browse files Browse the repository at this point in the history
Fixes #47 

### Motivation
Only create the initialize job on install. 

### Modifications

- Added an initialize value that can be set to true on install, matching the documentation in the README.md
  • Loading branch information
toneill818 committed Aug 13, 2020
1 parent 207d697 commit b44b523
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .ci/helm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ function ci::install_pulsar_chart() {
${CHARTS_HOME}/scripts/pulsar/upload_tls.sh -k ${CLUSTER} -d ${PULSAR_HOME}/.ci/tls
sleep 10

echo ${HELM} install --values ${value_file} ${CLUSTER} ${CHARTS_HOME}/charts/pulsar
echo ${HELM} install --set initialize=true --values ${value_file} ${CLUSTER} ${CHARTS_HOME}/charts/pulsar
${HELM} template --values ${value_file} ${CLUSTER} ${CHARTS_HOME}/charts/pulsar
${HELM} install --values ${value_file} ${CLUSTER} ${CHARTS_HOME}/charts/pulsar
${HELM} install --set initialize=true --values ${value_file} ${CLUSTER} ${CHARTS_HOME}/charts/pulsar

echo "wait until broker is alive"
WC=$(${KUBECTL} get pods -n ${NAMESPACE} --field-selector=status.phase=Running | grep ${CLUSTER}-broker | wc -l)
Expand Down
3 changes: 2 additions & 1 deletion charts/pulsar/templates/bookkeeper-cluster-initialize.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# specific language governing permissions and limitations
# under the License.
#

{{- if .Values.initialize }}
{{- if .Values.components.bookkeeper }}
apiVersion: batch/v1
kind: Job
Expand Down Expand Up @@ -75,3 +75,4 @@ spec:
{{- include "pulsar.toolset.certs.volumes" . | nindent 6 }}
restartPolicy: Never
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions charts/pulsar/templates/pulsar-cluster-initialize.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# under the License.
#

{{- if .Values.initialize }}
{{- if .Values.components.broker }}
apiVersion: batch/v1
kind: Job
Expand Down Expand Up @@ -106,3 +107,4 @@ spec:
{{- include "pulsar.toolset.certs.volumes" . | nindent 6 }}
restartPolicy: Never
{{- end }}
{{- end }}
3 changes: 3 additions & 0 deletions charts/pulsar/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ namespaceCreate: false
### Global Settings
###

## Set to true on install
initialize: false

## Pulsar Metadata Prefix
##
## By default, pulsar stores all the metadata at root path.
Expand Down

0 comments on commit b44b523

Please sign in to comment.