cmd: remotesource create don't force github defaults
Use default public github api only if no api-url is provided. Use default public github ssh host key only if the public github api url is provided and no ssh host key is provided.
This commit is contained in:
parent
3b09cfd6a6
commit
75541ad730
|
@ -83,10 +83,16 @@ func init() {
|
|||
func remoteSourceCreate(cmd *cobra.Command, args []string) error {
|
||||
gwclient := gwclient.NewClient(gatewayURL, token)
|
||||
|
||||
flags := cmd.Flags()
|
||||
|
||||
// for github remote source type, set defaults for github.com
|
||||
if remoteSourceCreateOpts.rsType == "github" {
|
||||
remoteSourceCreateOpts.apiURL = github.GitHubAPIURL
|
||||
remoteSourceCreateOpts.sshHostKey = github.GitHubSSHHostKey
|
||||
if !flags.Changed("api-url") {
|
||||
remoteSourceCreateOpts.apiURL = github.GitHubAPIURL
|
||||
}
|
||||
if remoteSourceCreateOpts.apiURL == github.GitHubAPIURL && !flags.Changed("ssh-host-key") {
|
||||
remoteSourceCreateOpts.sshHostKey = github.GitHubSSHHostKey
|
||||
}
|
||||
}
|
||||
|
||||
if remoteSourceCreateOpts.apiURL == "" {
|
||||
|
|
Loading…
Reference in New Issue