mirror of
https://github.com/fluxcd/flux2.git
synced 2026-04-20 18:45:43 +00:00
Add SSH hostname arg to GitLab bootstrap
This commit is contained in:
parent
7cb3bb0d4e
commit
b5ed8f0183
4 changed files with 25 additions and 18 deletions
|
|
@ -57,13 +57,14 @@ the bootstrap command will perform an upgrade if needed.`,
|
|||
}
|
||||
|
||||
var (
|
||||
glOwner string
|
||||
glRepository string
|
||||
glInterval time.Duration
|
||||
glPersonal bool
|
||||
glPrivate bool
|
||||
glHostname string
|
||||
glPath string
|
||||
glOwner string
|
||||
glRepository string
|
||||
glInterval time.Duration
|
||||
glPersonal bool
|
||||
glPrivate bool
|
||||
glHostname string
|
||||
glSSHHostname string
|
||||
glPath string
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
|
@ -73,6 +74,7 @@ func init() {
|
|||
bootstrapGitLabCmd.Flags().BoolVar(&glPrivate, "private", true, "is private repository")
|
||||
bootstrapGitLabCmd.Flags().DurationVar(&glInterval, "interval", time.Minute, "sync interval")
|
||||
bootstrapGitLabCmd.Flags().StringVar(&glHostname, "hostname", git.GitLabDefaultHostname, "GitLab hostname")
|
||||
bootstrapGitLabCmd.Flags().StringVar(&glSSHHostname, "ssh-hostname", "", "GitLab SSH hostname, defaults to hostname if not specified")
|
||||
bootstrapGitLabCmd.Flags().StringVar(&glPath, "path", "", "repository path, when specified the cluster sync will be scoped to this path")
|
||||
|
||||
bootstrapCmd.AddCommand(bootstrapGitLabCmd)
|
||||
|
|
@ -89,6 +91,10 @@ func bootstrapGitLabCmdRun(cmd *cobra.Command, args []string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
if glSSHHostname != "" {
|
||||
repository.SSHHost = glSSHHostname
|
||||
}
|
||||
|
||||
provider := &git.GitLabProvider{
|
||||
IsPrivate: glPrivate,
|
||||
IsPersonal: glPersonal,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue