Error if HTTP & SSH parameters provided
If both HTTP and SSH parameters are provided to the container on startup, return an error to help users that have confused their configurations.
This commit is contained in:
parent
f69e8fb2c0
commit
ef9bc21b8f
|
|
@ -149,6 +149,11 @@ func main() {
|
|||
os.Exit(1)
|
||||
}
|
||||
|
||||
if (*flUsername != "" || *flPassword != "" || *flCookieFile) && *flSSH {
|
||||
fmt.Fprintf(os.Stderr, "ERROR: GIT_SYNC_SSH set but HTTP parameters provided. These cannot be used together.")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
if *flUsername != "" && *flPassword != "" {
|
||||
if err := setupGitAuth(*flUsername, *flPassword, *flRepo); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "ERROR: can't create .netrc file: %v\n", err)
|
||||
|
|
|
|||
Loading…
Reference in New Issue