-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6e5a94e
commit 16c2d7a
Showing
3 changed files
with
51 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,7 +73,7 @@ func RunSyncProcess(args RunSyncProcessFunctionTypeArguments) error { | |
return err | ||
} | ||
|
||
err = SyncRunTransfer(args.SourceEnvironment, args.TargetEnvironment, args.LagoonSyncer, args.DryRun, args.SshOptions) | ||
err = SyncRunTransfer(args.SourceEnvironment, args.TargetEnvironment, args.LagoonSyncer, args.DryRun, args.SshOptions, args.TransferResourceName) | ||
if err != nil { | ||
_ = PrerequisiteCleanUp(args.SourceEnvironment, sourceRsyncPath, args.DryRun, args.SshOptions) | ||
_ = SyncCleanUp(args.SourceEnvironment, args.LagoonSyncer, args.DryRun, args.SshOptions) | ||
|
@@ -148,7 +148,7 @@ func SyncRunSourceCommand(remoteEnvironment Environment, syncer Syncer, dryRun b | |
return nil | ||
} | ||
|
||
func SyncRunTransfer(sourceEnvironment Environment, targetEnvironment Environment, syncer Syncer, dryRun bool, sshOptions SSHOptions) error { | ||
func SyncRunTransfer(sourceEnvironment Environment, targetEnvironment Environment, syncer Syncer, dryRun bool, sshOptions SSHOptions, transferResourceName string) error { | ||
utils.LogProcessStep("Beginning file transfer logic", nil) | ||
|
||
// If we're transferring to the same resource, we can skip this whole process. | ||
|
@@ -180,6 +180,13 @@ func SyncRunTransfer(sourceEnvironment Environment, targetEnvironment Environmen | |
// rsyncRemoteSystemUsername is used by the rsync command to set up the ssh tunnel | ||
rsyncRemoteSystemUsername := "" | ||
|
||
// checks transferResourceName is provided for a file sync | ||
if transferResourceName != "" { | ||
if _, ok := syncer.(*FilesSyncRoot); ok { | ||
sourceEnvironmentName = transferResourceName | ||
} | ||
} | ||
|
||
if sourceEnvironment.EnvironmentName != LOCAL_ENVIRONMENT_NAME { | ||
//sourceEnvironmentName = fmt.Sprintf("%[email protected]:%s", sourceEnvironment.GetOpenshiftProjectName(), sourceEnvironmentName) | ||
sourceEnvironmentName = fmt.Sprintf(":%s", sourceEnvironmentName) | ||
|