mirror of
https://github.com/fluxcd/flux2.git
synced 2026-02-25 00:51:48 +00:00
Add recurse submodules arg to bootstrap cmd
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
parent
18c3f79319
commit
b872e595ae
12 changed files with 23 additions and 10 deletions
|
|
@ -39,8 +39,9 @@ type bootstrapFlags struct {
|
||||||
arch flags.Arch
|
arch flags.Arch
|
||||||
logLevel flags.LogLevel
|
logLevel flags.LogLevel
|
||||||
|
|
||||||
branch string
|
branch string
|
||||||
manifestsPath string
|
recurseSubmodules bool
|
||||||
|
manifestsPath string
|
||||||
|
|
||||||
defaultComponents []string
|
defaultComponents []string
|
||||||
extraComponents []string
|
extraComponents []string
|
||||||
|
|
@ -89,8 +90,10 @@ func init() {
|
||||||
bootstrapCmd.PersistentFlags().StringVar(&bootstrapArgs.imagePullSecret, "image-pull-secret", "",
|
bootstrapCmd.PersistentFlags().StringVar(&bootstrapArgs.imagePullSecret, "image-pull-secret", "",
|
||||||
"Kubernetes secret name used for pulling the toolkit images from a private registry")
|
"Kubernetes secret name used for pulling the toolkit images from a private registry")
|
||||||
|
|
||||||
bootstrapCmd.PersistentFlags().StringVar(&bootstrapArgs.branch, "branch", bootstrapDefaultBranch,
|
bootstrapCmd.PersistentFlags().StringVar(&bootstrapArgs.branch, "branch", bootstrapDefaultBranch, "Git branch")
|
||||||
"default branch (for GitHub this must match the default branch setting for the organization)")
|
bootstrapCmd.PersistentFlags().BoolVar(&bootstrapArgs.recurseSubmodules, "recurse-submodules", false,
|
||||||
|
"when enabled, configures the GitRepository source to initialize and include Git submodules in the artifact it produces")
|
||||||
|
|
||||||
bootstrapCmd.PersistentFlags().StringVar(&bootstrapArgs.manifestsPath, "manifests", "", "path to the manifest directory")
|
bootstrapCmd.PersistentFlags().StringVar(&bootstrapArgs.manifestsPath, "manifests", "", "path to the manifest directory")
|
||||||
|
|
||||||
bootstrapCmd.PersistentFlags().BoolVar(&bootstrapArgs.watchAllNamespaces, "watch-all-namespaces", true,
|
bootstrapCmd.PersistentFlags().BoolVar(&bootstrapArgs.watchAllNamespaces, "watch-all-namespaces", true,
|
||||||
|
|
|
||||||
|
|
@ -189,6 +189,7 @@ func bootstrapGitCmdRun(cmd *cobra.Command, args []string) error {
|
||||||
TargetPath: gitArgs.path.String(),
|
TargetPath: gitArgs.path.String(),
|
||||||
ManifestFile: sync.MakeDefaultOptions().ManifestFile,
|
ManifestFile: sync.MakeDefaultOptions().ManifestFile,
|
||||||
GitImplementation: sourceGitArgs.gitImplementation.String(),
|
GitImplementation: sourceGitArgs.gitImplementation.String(),
|
||||||
|
RecurseSubmodules: bootstrapArgs.recurseSubmodules,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bootstrap config
|
// Bootstrap config
|
||||||
|
|
|
||||||
|
|
@ -211,6 +211,7 @@ func bootstrapGitHubCmdRun(cmd *cobra.Command, args []string) error {
|
||||||
TargetPath: githubArgs.path.String(),
|
TargetPath: githubArgs.path.String(),
|
||||||
ManifestFile: sync.MakeDefaultOptions().ManifestFile,
|
ManifestFile: sync.MakeDefaultOptions().ManifestFile,
|
||||||
GitImplementation: sourceGitArgs.gitImplementation.String(),
|
GitImplementation: sourceGitArgs.gitImplementation.String(),
|
||||||
|
RecurseSubmodules: bootstrapArgs.recurseSubmodules,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bootstrap config
|
// Bootstrap config
|
||||||
|
|
|
||||||
|
|
@ -227,6 +227,7 @@ func bootstrapGitLabCmdRun(cmd *cobra.Command, args []string) error {
|
||||||
TargetPath: gitlabArgs.path.String(),
|
TargetPath: gitlabArgs.path.String(),
|
||||||
ManifestFile: sync.MakeDefaultOptions().ManifestFile,
|
ManifestFile: sync.MakeDefaultOptions().ManifestFile,
|
||||||
GitImplementation: sourceGitArgs.gitImplementation.String(),
|
GitImplementation: sourceGitArgs.gitImplementation.String(),
|
||||||
|
RecurseSubmodules: bootstrapArgs.recurseSubmodules,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bootstrap config
|
// Bootstrap config
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,8 @@ func init() {
|
||||||
createSourceGitCmd.Flags().Var(&sourceGitArgs.gitImplementation, "git-implementation", sourceGitArgs.gitImplementation.Description())
|
createSourceGitCmd.Flags().Var(&sourceGitArgs.gitImplementation, "git-implementation", sourceGitArgs.gitImplementation.Description())
|
||||||
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.caFile, "ca-file", "", "path to TLS CA file used for validating self-signed certificates")
|
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.caFile, "ca-file", "", "path to TLS CA file used for validating self-signed certificates")
|
||||||
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.privateKeyFile, "private-key-file", "", "path to a passwordless private key file used for authenticating to the Git SSH server")
|
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.privateKeyFile, "private-key-file", "", "path to a passwordless private key file used for authenticating to the Git SSH server")
|
||||||
createSourceGitCmd.Flags().BoolVar(&sourceGitArgs.recurseSubmodules, "recurse-submodules", false, "when enabled, after the clone is created, initializes all Git submodules within")
|
createSourceGitCmd.Flags().BoolVar(&sourceGitArgs.recurseSubmodules, "recurse-submodules", false,
|
||||||
|
"when enabled, configures the GitRepository source to initialize and include Git submodules in the artifact it produces")
|
||||||
|
|
||||||
createSourceCmd.AddCommand(createSourceGitCmd)
|
createSourceCmd.AddCommand(createSourceGitCmd)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ The bootstrap sub-commands bootstrap the toolkit components on the targeted Git
|
||||||
```
|
```
|
||||||
--author-email string author email for Git commits
|
--author-email string author email for Git commits
|
||||||
--author-name string author name for Git commits (default "Flux")
|
--author-name string author name for Git commits (default "Flux")
|
||||||
--branch string default branch (for GitHub this must match the default branch setting for the organization) (default "main")
|
--branch string Git branch (default "main")
|
||||||
--ca-file string path to TLS CA file used for validating self-signed certificates
|
--ca-file string path to TLS CA file used for validating self-signed certificates
|
||||||
--cluster-domain string internal cluster domain (default "cluster.local")
|
--cluster-domain string internal cluster domain (default "cluster.local")
|
||||||
--commit-message-appendix string string to add to the commit messages, e.g. '[ci skip]'
|
--commit-message-appendix string string to add to the commit messages, e.g. '[ci skip]'
|
||||||
|
|
@ -25,6 +25,7 @@ The bootstrap sub-commands bootstrap the toolkit components on the targeted Git
|
||||||
--log-level logLevel log level, available options are: (debug, info, error) (default info)
|
--log-level logLevel log level, available options are: (debug, info, error) (default info)
|
||||||
--network-policy deny ingress access to the toolkit controllers from other namespaces using network policies (default true)
|
--network-policy deny ingress access to the toolkit controllers from other namespaces using network policies (default true)
|
||||||
--private-key-file string path to a private key file used for authenticating to the Git SSH server
|
--private-key-file string path to a private key file used for authenticating to the Git SSH server
|
||||||
|
--recurse-submodules when enabled, configures the GitRepository source to initialize and include Git submodules in the artifact it produces
|
||||||
--registry string container registry where the toolkit images are published (default "ghcr.io/fluxcd")
|
--registry string container registry where the toolkit images are published (default "ghcr.io/fluxcd")
|
||||||
--secret-name string name of the secret the sync credentials can be found in or stored to (default "flux-system")
|
--secret-name string name of the secret the sync credentials can be found in or stored to (default "flux-system")
|
||||||
--ssh-ecdsa-curve ecdsaCurve SSH ECDSA public key curve (p256, p384, p521) (default p384)
|
--ssh-ecdsa-curve ecdsaCurve SSH ECDSA public key curve (p256, p384, p521) (default p384)
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ flux bootstrap git [flags]
|
||||||
```
|
```
|
||||||
--author-email string author email for Git commits
|
--author-email string author email for Git commits
|
||||||
--author-name string author name for Git commits (default "Flux")
|
--author-name string author name for Git commits (default "Flux")
|
||||||
--branch string default branch (for GitHub this must match the default branch setting for the organization) (default "main")
|
--branch string Git branch (default "main")
|
||||||
--ca-file string path to TLS CA file used for validating self-signed certificates
|
--ca-file string path to TLS CA file used for validating self-signed certificates
|
||||||
--cluster-domain string internal cluster domain (default "cluster.local")
|
--cluster-domain string internal cluster domain (default "cluster.local")
|
||||||
--commit-message-appendix string string to add to the commit messages, e.g. '[ci skip]'
|
--commit-message-appendix string string to add to the commit messages, e.g. '[ci skip]'
|
||||||
|
|
@ -59,6 +59,7 @@ flux bootstrap git [flags]
|
||||||
-n, --namespace string the namespace scope for this operation (default "flux-system")
|
-n, --namespace string the namespace scope for this operation (default "flux-system")
|
||||||
--network-policy deny ingress access to the toolkit controllers from other namespaces using network policies (default true)
|
--network-policy deny ingress access to the toolkit controllers from other namespaces using network policies (default true)
|
||||||
--private-key-file string path to a private key file used for authenticating to the Git SSH server
|
--private-key-file string path to a private key file used for authenticating to the Git SSH server
|
||||||
|
--recurse-submodules when enabled, configures the GitRepository source to initialize and include Git submodules in the artifact it produces
|
||||||
--registry string container registry where the toolkit images are published (default "ghcr.io/fluxcd")
|
--registry string container registry where the toolkit images are published (default "ghcr.io/fluxcd")
|
||||||
--secret-name string name of the secret the sync credentials can be found in or stored to (default "flux-system")
|
--secret-name string name of the secret the sync credentials can be found in or stored to (default "flux-system")
|
||||||
--ssh-ecdsa-curve ecdsaCurve SSH ECDSA public key curve (p256, p384, p521) (default p384)
|
--ssh-ecdsa-curve ecdsaCurve SSH ECDSA public key curve (p256, p384, p521) (default p384)
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ flux bootstrap github [flags]
|
||||||
```
|
```
|
||||||
--author-email string author email for Git commits
|
--author-email string author email for Git commits
|
||||||
--author-name string author name for Git commits (default "Flux")
|
--author-name string author name for Git commits (default "Flux")
|
||||||
--branch string default branch (for GitHub this must match the default branch setting for the organization) (default "main")
|
--branch string Git branch (default "main")
|
||||||
--ca-file string path to TLS CA file used for validating self-signed certificates
|
--ca-file string path to TLS CA file used for validating self-signed certificates
|
||||||
--cluster-domain string internal cluster domain (default "cluster.local")
|
--cluster-domain string internal cluster domain (default "cluster.local")
|
||||||
--commit-message-appendix string string to add to the commit messages, e.g. '[ci skip]'
|
--commit-message-appendix string string to add to the commit messages, e.g. '[ci skip]'
|
||||||
|
|
@ -78,6 +78,7 @@ flux bootstrap github [flags]
|
||||||
-n, --namespace string the namespace scope for this operation (default "flux-system")
|
-n, --namespace string the namespace scope for this operation (default "flux-system")
|
||||||
--network-policy deny ingress access to the toolkit controllers from other namespaces using network policies (default true)
|
--network-policy deny ingress access to the toolkit controllers from other namespaces using network policies (default true)
|
||||||
--private-key-file string path to a private key file used for authenticating to the Git SSH server
|
--private-key-file string path to a private key file used for authenticating to the Git SSH server
|
||||||
|
--recurse-submodules when enabled, configures the GitRepository source to initialize and include Git submodules in the artifact it produces
|
||||||
--registry string container registry where the toolkit images are published (default "ghcr.io/fluxcd")
|
--registry string container registry where the toolkit images are published (default "ghcr.io/fluxcd")
|
||||||
--secret-name string name of the secret the sync credentials can be found in or stored to (default "flux-system")
|
--secret-name string name of the secret the sync credentials can be found in or stored to (default "flux-system")
|
||||||
--ssh-ecdsa-curve ecdsaCurve SSH ECDSA public key curve (p256, p384, p521) (default p384)
|
--ssh-ecdsa-curve ecdsaCurve SSH ECDSA public key curve (p256, p384, p521) (default p384)
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ flux bootstrap gitlab [flags]
|
||||||
```
|
```
|
||||||
--author-email string author email for Git commits
|
--author-email string author email for Git commits
|
||||||
--author-name string author name for Git commits (default "Flux")
|
--author-name string author name for Git commits (default "Flux")
|
||||||
--branch string default branch (for GitHub this must match the default branch setting for the organization) (default "main")
|
--branch string Git branch (default "main")
|
||||||
--ca-file string path to TLS CA file used for validating self-signed certificates
|
--ca-file string path to TLS CA file used for validating self-signed certificates
|
||||||
--cluster-domain string internal cluster domain (default "cluster.local")
|
--cluster-domain string internal cluster domain (default "cluster.local")
|
||||||
--commit-message-appendix string string to add to the commit messages, e.g. '[ci skip]'
|
--commit-message-appendix string string to add to the commit messages, e.g. '[ci skip]'
|
||||||
|
|
@ -75,6 +75,7 @@ flux bootstrap gitlab [flags]
|
||||||
-n, --namespace string the namespace scope for this operation (default "flux-system")
|
-n, --namespace string the namespace scope for this operation (default "flux-system")
|
||||||
--network-policy deny ingress access to the toolkit controllers from other namespaces using network policies (default true)
|
--network-policy deny ingress access to the toolkit controllers from other namespaces using network policies (default true)
|
||||||
--private-key-file string path to a private key file used for authenticating to the Git SSH server
|
--private-key-file string path to a private key file used for authenticating to the Git SSH server
|
||||||
|
--recurse-submodules when enabled, configures the GitRepository source to initialize and include Git submodules in the artifact it produces
|
||||||
--registry string container registry where the toolkit images are published (default "ghcr.io/fluxcd")
|
--registry string container registry where the toolkit images are published (default "ghcr.io/fluxcd")
|
||||||
--secret-name string name of the secret the sync credentials can be found in or stored to (default "flux-system")
|
--secret-name string name of the secret the sync credentials can be found in or stored to (default "flux-system")
|
||||||
--ssh-ecdsa-curve ecdsaCurve SSH ECDSA public key curve (p256, p384, p521) (default p384)
|
--ssh-ecdsa-curve ecdsaCurve SSH ECDSA public key curve (p256, p384, p521) (default p384)
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ flux create source git [name] [flags]
|
||||||
-h, --help help for git
|
-h, --help help for git
|
||||||
-p, --password string basic authentication password
|
-p, --password string basic authentication password
|
||||||
--private-key-file string path to a passwordless private key file used for authenticating to the Git SSH server
|
--private-key-file string path to a passwordless private key file used for authenticating to the Git SSH server
|
||||||
--recurse-submodules when enabled, after the clone is created, initializes all Git submodules within
|
--recurse-submodules when enabled, configures the GitRepository source to initialize and include Git submodules in the artifact it produces
|
||||||
--secret-ref string the name of an existing secret containing SSH or basic credentials
|
--secret-ref string the name of an existing secret containing SSH or basic credentials
|
||||||
--ssh-ecdsa-curve ecdsaCurve SSH ECDSA public key curve (p256, p384, p521) (default p384)
|
--ssh-ecdsa-curve ecdsaCurve SSH ECDSA public key curve (p256, p384, p521) (default p384)
|
||||||
--ssh-key-algorithm publicKeyAlgorithm SSH public key algorithm (rsa, ecdsa, ed25519) (default rsa)
|
--ssh-key-algorithm publicKeyAlgorithm SSH public key algorithm (rsa, ecdsa, ed25519) (default rsa)
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ type Options struct {
|
||||||
TargetPath string
|
TargetPath string
|
||||||
ManifestFile string
|
ManifestFile string
|
||||||
GitImplementation string
|
GitImplementation string
|
||||||
|
RecurseSubmodules bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func MakeDefaultOptions() Options {
|
func MakeDefaultOptions() Options {
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,7 @@ func Generate(options Options) (*manifestgen.Manifest, error) {
|
||||||
Name: options.Secret,
|
Name: options.Secret,
|
||||||
},
|
},
|
||||||
GitImplementation: options.GitImplementation,
|
GitImplementation: options.GitImplementation,
|
||||||
|
RecurseSubmodules: options.RecurseSubmodules,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue