Skip to content

Commit

Permalink
Issue 82: Handling Bookkeeper Upgrade (#85)
Browse files Browse the repository at this point in the history
* Issue 82: Handling Bookkeeper Upgrade

Signed-off-by: SrishT <[email protected]>

* Issue 82: Handling Bookkeeper Upgrade

Signed-off-by: SrishT <[email protected]>

* Issue 82: Updating documentation

Signed-off-by: SrishT <[email protected]>

Co-authored-by: SrishT <[email protected]>
  • Loading branch information
SrishT and SrishT authored Nov 11, 2020
1 parent 22f5cb8 commit 0501b7c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
5 changes: 3 additions & 2 deletions charts/bookkeeper/templates/bookkeeper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ metadata:
spec:
replicas: {{ .Values.replicas }}
image:
repository: {{ .Values.image.repository }}
pullPolicy: {{ .Values.image.pullPolicy }}
imageSpec:
repository: {{ .Values.image.repository }}
pullPolicy: {{ .Values.image.pullPolicy }}
version: {{ .Values.version }}
zookeeperUri: {{ .Values.zookeeperUri }}
envVars: {{ template "bookkeeper.fullname" . }}-configmap
Expand Down
5 changes: 3 additions & 2 deletions deploy/crds/cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ spec:
version: 0.7.0
zookeeperUri: zookeeper-client:2181
image:
repository: pravega/bookkeeper
pullPolicy: IfNotPresent
imageSpec:
repository: pravega/bookkeeper
pullPolicy: IfNotPresent
replicas: 3
envVars: bookkeeper-configmap
autoRecovery: true
Expand Down
5 changes: 3 additions & 2 deletions doc/manual-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@ spec:
envVars: bookkeeper-configmap
replicas: 3
image:
repository: pravega/bookkeeper
pullPolicy: IfNotPresent
imageSpec:
repository: pravega/bookkeeper
pullPolicy: IfNotPresent
```
where:
Expand Down
4 changes: 3 additions & 1 deletion example/cr-detailed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ spec:
zookeeperUri: zookeeper-client:2181

image:
repository: pravega/bookkeeper
imageSpec:
repository: pravega/bookkeeper
pullPolicy: IfNotPresent

replicas: 3

Expand Down
5 changes: 5 additions & 0 deletions pkg/controller/bookkeepercluster/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ package bookkeepercluster
import (
"context"
"fmt"
"sort"
"time"

bookkeeperv1alpha1 "github.com/pravega/bookkeeper-operator/pkg/apis/bookkeeper/v1alpha1"
Expand Down Expand Up @@ -316,6 +317,10 @@ func (r *ReconcileBookkeeperCluster) getOneOutdatedPod(sts *appsv1.StatefulSet,
return nil, err
}

sort.SliceStable(podList.Items, func(i int, j int) bool {
return podList.Items[i].Name < podList.Items[j].Name
})

for _, podItem := range podList.Items {
if util.GetPodVersion(&podItem) == version {
continue
Expand Down

0 comments on commit 0501b7c

Please sign in to comment.