Add SSH hostname arg to GitLab bootstrap
This commit is contained in:
@@ -57,13 +57,14 @@ the bootstrap command will perform an upgrade if needed.`,
|
|||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
glOwner string
|
glOwner string
|
||||||
glRepository string
|
glRepository string
|
||||||
glInterval time.Duration
|
glInterval time.Duration
|
||||||
glPersonal bool
|
glPersonal bool
|
||||||
glPrivate bool
|
glPrivate bool
|
||||||
glHostname string
|
glHostname string
|
||||||
glPath string
|
glSSHHostname string
|
||||||
|
glPath string
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@@ -73,6 +74,7 @@ func init() {
|
|||||||
bootstrapGitLabCmd.Flags().BoolVar(&glPrivate, "private", true, "is private repository")
|
bootstrapGitLabCmd.Flags().BoolVar(&glPrivate, "private", true, "is private repository")
|
||||||
bootstrapGitLabCmd.Flags().DurationVar(&glInterval, "interval", time.Minute, "sync interval")
|
bootstrapGitLabCmd.Flags().DurationVar(&glInterval, "interval", time.Minute, "sync interval")
|
||||||
bootstrapGitLabCmd.Flags().StringVar(&glHostname, "hostname", git.GitLabDefaultHostname, "GitLab hostname")
|
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")
|
bootstrapGitLabCmd.Flags().StringVar(&glPath, "path", "", "repository path, when specified the cluster sync will be scoped to this path")
|
||||||
|
|
||||||
bootstrapCmd.AddCommand(bootstrapGitLabCmd)
|
bootstrapCmd.AddCommand(bootstrapGitLabCmd)
|
||||||
@@ -89,6 +91,10 @@ func bootstrapGitLabCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if glSSHHostname != "" {
|
||||||
|
repository.SSHHost = glSSHHostname
|
||||||
|
}
|
||||||
|
|
||||||
provider := &git.GitLabProvider{
|
provider := &git.GitLabProvider{
|
||||||
IsPrivate: glPrivate,
|
IsPrivate: glPrivate,
|
||||||
IsPersonal: glPersonal,
|
IsPersonal: glPersonal,
|
||||||
|
|||||||
@@ -37,14 +37,15 @@ tk bootstrap gitlab [flags]
|
|||||||
### Options
|
### Options
|
||||||
|
|
||||||
```
|
```
|
||||||
-h, --help help for gitlab
|
-h, --help help for gitlab
|
||||||
--hostname string GitLab hostname (default "gitlab.com")
|
--hostname string GitLab hostname (default "gitlab.com")
|
||||||
--interval duration sync interval (default 1m0s)
|
--interval duration sync interval (default 1m0s)
|
||||||
--owner string GitLab user or group name
|
--owner string GitLab user or group name
|
||||||
--path string repository path, when specified the cluster sync will be scoped to this path
|
--path string repository path, when specified the cluster sync will be scoped to this path
|
||||||
--personal is personal repository
|
--personal is personal repository
|
||||||
--private is private repository (default true)
|
--private is private repository (default true)
|
||||||
--repository string GitLab repository name
|
--repository string GitLab repository name
|
||||||
|
--ssh-hostname string GitLab SSH hostname, defaults to hostname if not specified
|
||||||
```
|
```
|
||||||
|
|
||||||
### Options inherited from parent commands
|
### Options inherited from parent commands
|
||||||
|
|||||||
2
go.mod
2
go.mod
@@ -6,7 +6,7 @@ require (
|
|||||||
github.com/blang/semver v3.5.1+incompatible
|
github.com/blang/semver v3.5.1+incompatible
|
||||||
github.com/fluxcd/helm-controller/api v0.0.3
|
github.com/fluxcd/helm-controller/api v0.0.3
|
||||||
github.com/fluxcd/kustomize-controller/api v0.0.8
|
github.com/fluxcd/kustomize-controller/api v0.0.8
|
||||||
github.com/fluxcd/pkg/git v0.0.5
|
github.com/fluxcd/pkg/git v0.0.6
|
||||||
github.com/fluxcd/pkg/ssh v0.0.5
|
github.com/fluxcd/pkg/ssh v0.0.5
|
||||||
github.com/fluxcd/pkg/untar v0.0.5
|
github.com/fluxcd/pkg/untar v0.0.5
|
||||||
github.com/fluxcd/source-controller/api v0.0.10
|
github.com/fluxcd/source-controller/api v0.0.10
|
||||||
|
|||||||
4
go.sum
4
go.sum
@@ -114,8 +114,8 @@ github.com/fluxcd/helm-controller/api v0.0.3 h1:W3/XAKjd6QOu6NG1KXsDXFlgEAukygLK
|
|||||||
github.com/fluxcd/helm-controller/api v0.0.3/go.mod h1:YCQhNz7LkYyBGxDdMGSRK78nvhuHV2x/lrn2vuRlBNE=
|
github.com/fluxcd/helm-controller/api v0.0.3/go.mod h1:YCQhNz7LkYyBGxDdMGSRK78nvhuHV2x/lrn2vuRlBNE=
|
||||||
github.com/fluxcd/kustomize-controller/api v0.0.8 h1:Yi5/MZuS2jXiRV73fuUkBCyRTuG0yx2HJTpWZaM+WHA=
|
github.com/fluxcd/kustomize-controller/api v0.0.8 h1:Yi5/MZuS2jXiRV73fuUkBCyRTuG0yx2HJTpWZaM+WHA=
|
||||||
github.com/fluxcd/kustomize-controller/api v0.0.8/go.mod h1:c4035rZrt2p3RExpLe64ASVEvePm7FjiY4PzHKpRJXI=
|
github.com/fluxcd/kustomize-controller/api v0.0.8/go.mod h1:c4035rZrt2p3RExpLe64ASVEvePm7FjiY4PzHKpRJXI=
|
||||||
github.com/fluxcd/pkg/git v0.0.5 h1:6ahtjxZid8r94jmfOf1JUO42jX98FgdzBHrOaTGMCqY=
|
github.com/fluxcd/pkg/git v0.0.6 h1:4qktw8M3zj98MAs4ny6qSi36sYvTiI1czif5FqlQl4o=
|
||||||
github.com/fluxcd/pkg/git v0.0.5/go.mod h1:9AI9yPkb2ruIcE70moVG3WhunA2/RAMJPc3rtoH8QFE=
|
github.com/fluxcd/pkg/git v0.0.6/go.mod h1:9AI9yPkb2ruIcE70moVG3WhunA2/RAMJPc3rtoH8QFE=
|
||||||
github.com/fluxcd/pkg/ssh v0.0.5 h1:rnbFZ7voy2JBlUfMbfyqArX2FYaLNpDhccGFC3qW83A=
|
github.com/fluxcd/pkg/ssh v0.0.5 h1:rnbFZ7voy2JBlUfMbfyqArX2FYaLNpDhccGFC3qW83A=
|
||||||
github.com/fluxcd/pkg/ssh v0.0.5/go.mod h1:7jXPdXZpc0ttMNz2kD9QuMi3RNn/e0DOFbj0Tij/+Hs=
|
github.com/fluxcd/pkg/ssh v0.0.5/go.mod h1:7jXPdXZpc0ttMNz2kD9QuMi3RNn/e0DOFbj0Tij/+Hs=
|
||||||
github.com/fluxcd/pkg/untar v0.0.5 h1:UGI3Ch1UIEIaqQvMicmImL1s9npQa64DJ/ozqHKB7gk=
|
github.com/fluxcd/pkg/untar v0.0.5 h1:UGI3Ch1UIEIaqQvMicmImL1s9npQa64DJ/ozqHKB7gk=
|
||||||
|
|||||||
Reference in New Issue
Block a user