Skip to content

Commit

Permalink
Allow nodeName to be set in blockrsync options (#125)
Browse files Browse the repository at this point in the history
If the source volume is RWO we need to ensure the
blockrsync client is started on the same node as the
running pod. This change allows the nodeName to be
set in the blockrsync options.

Signed-off-by: Alexander Wels <[email protected]>
  • Loading branch information
awels authored Aug 5, 2024
1 parent d53911c commit 005b344
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions state_transfer/transfer/blockrsync/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ func createBlockrsyncClient(c client.Client, r *BlockrsyncTransfer, pvc transfer
RestartPolicy: v1.RestartPolicyOnFailure,
},
}
if r.transferOptions.NodeName != "" {
pod.Spec.NodeName = r.transferOptions.NodeName
}

return c.Create(context.TODO(), &pod, &client.CreateOptions{})
}
Expand Down
1 change: 1 addition & 0 deletions state_transfer/transfer/blockrsync/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ type TransferOptions struct {
password string
blockrsyncServerImage string
blockrsyncClientImage string
NodeName string
}

func (t *TransferOptions) GetBlockrsyncServerImage() string {
Expand Down

0 comments on commit 005b344

Please sign in to comment.