Skip to content

Commit

Permalink
add new flag 'ssh-host' to flux bootstrap git
Browse files Browse the repository at this point in the history
Add a new flag `ssh-host` to the flux bootstrap git command which
enables users to specify the hostname of the Git SSH server in case its
different than the Git HTTP(s) server. Azure Devops is an example, with
its HTTPS server hosted at dev.azure.com and its SSH server hosted at
ssh.dev.azure.com.

Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
  • Loading branch information
aryan9600 committed Nov 9, 2022
1 parent c5150ae commit 007e0a3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/flux/bootstrap_git.go
Expand Up @@ -72,6 +72,7 @@ type gitFlags struct {
password string
silent bool
insecureHttpAllowed bool
sshHost string
}

const (
Expand All @@ -88,6 +89,7 @@ func init() {
bootstrapGitCmd.Flags().StringVarP(&gitArgs.password, "password", "p", "", "basic authentication password")
bootstrapGitCmd.Flags().BoolVarP(&gitArgs.silent, "silent", "s", false, "assumes the deploy key is already setup, skips confirmation")
bootstrapGitCmd.Flags().BoolVar(&gitArgs.insecureHttpAllowed, "allow-insecure-http", false, "allows http git url connections")
bootstrapGitCmd.Flags().StringVar(&gitArgs.sshHost, "ssh-host", "", "Git SSH server host (to be used if the SSH server host is different than the HTTP(s) host)")

bootstrapCmd.AddCommand(bootstrapGitCmd)
}
Expand Down Expand Up @@ -229,6 +231,9 @@ func bootstrapGitCmdRun(cmd *cobra.Command, args []string) error {

// Configure last as it depends on the config above.
secretOpts.SSHHostname = repositoryURL.Host
if gitArgs.sshHost != "" {
secretOpts.SSHHostname = gitArgs.sshHost
}
}

// Sync manifest config
Expand Down

0 comments on commit 007e0a3

Please sign in to comment.