rbdmirror: with multus gen file on remote container

In case of RDR with multus, the file which contains peer
connection details need to generated on mgr proxy remote
since rbd commands in multus, commands are run via mgr
proxy container and not the rook operator pod.

Co-Authored-by: Madhu Rajanna <madhupr007@gmail.com>
Signed-off-by: subhamkrai <srai@redhat.com>
This commit is contained in:
subhamkraiandMadhu Rajanna committed 2025-07-24 12:27:52 +05:30
1 parent af6545d79f
commit fb1047eb10
1 file changed
+14
+14
View File
@@ -85,6 +85,20 @@ func ImportRBDMirrorBootstrapPeer(context *clusterd.Context, clusterInfo *Cluste
return err
}() //nolint // we don't want to return here
if clusterInfo.NetworkSpec.IsMultus() {
err = context.RemoteExecutor.CopyLocalFileToContainer(clusterInfo.Context, ProxyAppLabel, CommandProxyInitContainerName, clusterInfo.Namespace, tokenFilePath.Name(), tokenFilePath.Name())
if err != nil {
return err
}
defer func() {
// cleanup copied file in remote container
_, stdErr, cleanupErr := context.RemoteExecutor.ExecCommandInContainerWithFullOutput(clusterInfo.Context, ProxyAppLabel, CommandProxyInitContainerName, clusterInfo.Namespace, []string{"rm", tokenFilePath.Name()}...)
if cleanupErr != nil {
logger.Errorf("failed to cleanup remote file %q: %s - %s", tokenFilePath.Name(), cleanupErr, stdErr)
}
}()
}
// Build command
args := []string{"mirror", "pool", "peer", "bootstrap", "import", poolName, tokenFilePath.Name()}
if direction != "" {