-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #106 from flownative/feature/cluster-flag
Allow to specify cluster for resource download/upload
- Loading branch information
Showing
3 changed files
with
37 additions
and
25 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,8 @@ import ( | |
asset "github.com/flownative/localbeach/assets" | ||
) | ||
|
||
var instanceIdentifier, projectNamespace, clusterIdentifier string | ||
|
||
func copyFileFromAssets(src, dst string) (int64, error) { | ||
source, err := asset.Assets.Open(src) | ||
if err != nil { | ||
|
@@ -90,12 +92,18 @@ func getRelativePersistentResourcePathByHash(hash string) string { | |
} | ||
} | ||
|
||
func retrieveCloudStorageCredentials(instanceIdentifier string, projectNamespace string) (err error, bucketName string, privateKey []byte) { | ||
func retrieveCloudStorageCredentials(instanceIdentifier string, projectNamespace string, clusterIdentifier string) (err error, bucketName string, privateKey []byte) { | ||
log.Info("Retrieving cloud storage access data from instance") | ||
|
||
internalHost := "beach@" + instanceIdentifier + "." + projectNamespace | ||
jumpHost := "" | ||
if clusterIdentifier != "" { | ||
jumpHost = "beach@ssh." + clusterIdentifier + ".flownative.cloud" | ||
} else { | ||
jumpHost = "[email protected]" | ||
} | ||
output, err := exec.RunCommand("ssh", []string{ | ||
"-J", "[email protected]", internalHost, | ||
"-J", jumpHost, internalHost, | ||
"/bin/bash", "-c", "env | grep BEACH_GOOGLE_CLOUD_STORAGE_", | ||
}) | ||
if err != nil { | ||
|
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