Skip to content

Commit

Permalink
Rolling Upgrade fails when memcached or RESP endpoint not defined on…
Browse files Browse the repository at this point in the history
… original cluster. Fixes #2140
  • Loading branch information
ryanemerson committed Aug 12, 2024
1 parent 0e50f9b commit db1957d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/infinispan/upgrades/rolling_upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ func ConnectCaches(user, adminPasswordSource, sourceIp string, sourceClient, tar
}

// SyncCaches Do a sync data operation for each cache in a cluster
func SyncCaches(targetClient api.Infinispan, logger logr.Logger) error {
names, err := cacheNames(targetClient)
func SyncCaches(sourceClient, targetClient api.Infinispan, logger logr.Logger) error {
names, err := cacheNames(sourceClient)
if err != nil {
return fmt.Errorf("failed to get cache names from the target cluster: %w", err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -474,9 +474,13 @@ func (r *HotRodRollingUpgradeRequest) syncData() error {
return fmt.Errorf("failed to obtain pods from the target cluster: %w", err)
}

sourceClient, err := ctx.InfinispanClient()
if err != nil {
return err
}
// Clone the source curl client as the credentials are the same, updating the pod to one from the target statefulset
targetClient := ctx.InfinispanClientForPod(podList.Items[0].Name)
if err = upgrades.SyncCaches(targetClient, r.log); err != nil {
if err = upgrades.SyncCaches(sourceClient, targetClient, r.log); err != nil {
return err
}

Expand Down

0 comments on commit db1957d

Please sign in to comment.