MCPcopy Create free account
hub / github.com/OpenAtomFoundation/SmartIDE / remoteContainerCredentialCache

Function remoteContainerCredentialCache

cli/cmd/start/vm.go:439–450  ·  view source on GitHub ↗

缓存git 用户名、密码

(sshRemote common.SSHRemote, containerId string, workspaceInfo workspace.WorkspaceInfo)

Source from the content-addressed store, hash-verified

437
438// 缓存git 用户名、密码
439func remoteContainerCredentialCache(sshRemote common.SSHRemote, containerId string, workspaceInfo workspace.WorkspaceInfo) {
440
441 if workspaceInfo.GitRepoAuthType != workspace.GitRepoAuthType_Basic {
442 return
443 }
444
445 command := fmt.Sprintf(` docker exec -d %v /bin/sh -c \"git config --global user.name '%v' && git config --global user.password '%v' && git config --global credential.helper store\"`,
446 containerId, workspaceInfo.GitUserName, workspaceInfo.GitPassword)
447
448 sshRemote.ExecSSHCommandRealTime(command)
449
450}
451
452// 打印 service 列表
453func printServices(services map[string]compose.Service) {

Callers 1

ExecuteVmStartCmdFunction · 0.85

Calls 1

Tested by

no test coverage detected