Skip to content

Commit

Permalink
Allow bk cluster init to restart on failure (#303)
Browse files Browse the repository at this point in the history
### Motivation

This is essentially the same as #176. Without this change, an init pod can fail and be in `Error` state even though the second pod succeeded. This will prevent misleading errors.

### Modifications

* Replace `Never` with `OnFailure`

### Verifying this change

This is a trivial change.
  • Loading branch information
michaeljmarshall committed Oct 17, 2022
1 parent 25f355e commit 48501eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion charts/pulsar/templates/bookkeeper-cluster-initialize.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@ spec:
{{- include "pulsar.toolset.certs.volumeMounts" . | nindent 8 }}
volumes:
{{- include "pulsar.toolset.certs.volumes" . | nindent 6 }}
restartPolicy: Never
restartPolicy: OnFailure
{{- end }}
{{- end }}

2 comments on commit 48501eb

@lhotari
Copy link
Member

Choose a reason for hiding this comment

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

To match #176, I think it would be necessary to remove || yes from

bin/bookkeeper org.apache.zookeeper.ZooKeeperMain -server {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }} create {{ .Values.metadataPrefix }} 'created for pulsar cluster "{{ template "pulsar.cluster.name" . }}"' || yes &&
. WDYT?
(That is a code path that is taken only when metadataPrefix is set.)

@michaeljmarshall
Copy link
Member Author

Choose a reason for hiding this comment

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

Great catch, thank you for your review. I'll submit a PR to update it.

Please sign in to comment.