mirror of
https://github.com/fluxcd/flux2.git
synced 2026-06-28 18:05:08 +00:00
Merge pull request #5918 from piny940/main
Some checks failed
e2e / e2e-amd64-kubernetes (push) Has been cancelled
scan / analyze (push) Has been cancelled
ossf / scorecard (push) Has been cancelled
update / update-components (push) Has been cancelled
conformance / conform-kubernetes (1.34.1) (push) Has been cancelled
conformance / conform-kubernetes (1.35.2) (push) Has been cancelled
conformance / conform-kubernetes (1.36.1) (push) Has been cancelled
conformance / conform-k3s (1.34.8) (push) Has been cancelled
conformance / conform-k3s (1.35.5) (push) Has been cancelled
conformance / conform-k3s (1.36.1) (push) Has been cancelled
conformance / conform-openshift (4.20.0-okd) (push) Has been cancelled
conformance / conform-openshift (4.21.0-okd) (push) Has been cancelled
e2e-bootstrap / e2e-boostrap-github (push) Has been cancelled
Some checks failed
e2e / e2e-amd64-kubernetes (push) Has been cancelled
scan / analyze (push) Has been cancelled
ossf / scorecard (push) Has been cancelled
update / update-components (push) Has been cancelled
conformance / conform-kubernetes (1.34.1) (push) Has been cancelled
conformance / conform-kubernetes (1.35.2) (push) Has been cancelled
conformance / conform-kubernetes (1.36.1) (push) Has been cancelled
conformance / conform-k3s (1.34.8) (push) Has been cancelled
conformance / conform-k3s (1.35.5) (push) Has been cancelled
conformance / conform-k3s (1.36.1) (push) Has been cancelled
conformance / conform-openshift (4.20.0-okd) (push) Has been cancelled
conformance / conform-openshift (4.21.0-okd) (push) Has been cancelled
e2e-bootstrap / e2e-boostrap-github (push) Has been cancelled
Support specifing sparseCheckout in flux bootstrap
This commit is contained in:
commit
7a725fc3ad
8 changed files with 10 additions and 0 deletions
|
|
@ -47,6 +47,7 @@ type bootstrapFlags struct {
|
|||
|
||||
branch string
|
||||
recurseSubmodules bool
|
||||
sparseCheckout []string
|
||||
manifestsPath string
|
||||
|
||||
defaultComponents []string
|
||||
|
|
@ -109,6 +110,8 @@ func init() {
|
|||
bootstrapCmd.PersistentFlags().StringVar(&bootstrapArgs.branch, "branch", bootstrapDefaultBranch, "Git branch")
|
||||
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().StringSliceVar(&bootstrapArgs.sparseCheckout, "sparse-checkout", nil,
|
||||
"list of directories to be included in the GitRepository sparse checkout, the configured --path must be one of them, accepts comma-separated values")
|
||||
|
||||
bootstrapCmd.PersistentFlags().StringVar(&bootstrapArgs.manifestsPath, "manifests", "", "path to the manifest directory")
|
||||
|
||||
|
|
|
|||
|
|
@ -253,6 +253,7 @@ func bootstrapBServerCmdRun(cmd *cobra.Command, args []string) error {
|
|||
TargetPath: bServerArgs.path.ToSlash(),
|
||||
ManifestFile: sync.MakeDefaultOptions().ManifestFile,
|
||||
RecurseSubmodules: bootstrapArgs.recurseSubmodules,
|
||||
SparseCheckout: bootstrapArgs.sparseCheckout,
|
||||
}
|
||||
|
||||
entityList, err := bootstrap.LoadEntityListFromPath(bootstrapArgs.gpgKeyRingPath)
|
||||
|
|
|
|||
|
|
@ -311,6 +311,7 @@ func bootstrapGitCmdRun(cmd *cobra.Command, args []string) error {
|
|||
TargetPath: gitArgs.path.ToSlash(),
|
||||
ManifestFile: sync.MakeDefaultOptions().ManifestFile,
|
||||
RecurseSubmodules: bootstrapArgs.recurseSubmodules,
|
||||
SparseCheckout: bootstrapArgs.sparseCheckout,
|
||||
}
|
||||
if gitProvider != "" {
|
||||
syncOpts.Provider = gitProvider
|
||||
|
|
|
|||
|
|
@ -232,6 +232,7 @@ func bootstrapGiteaCmdRun(cmd *cobra.Command, args []string) error {
|
|||
TargetPath: giteaArgs.path.ToSlash(),
|
||||
ManifestFile: sync.MakeDefaultOptions().ManifestFile,
|
||||
RecurseSubmodules: bootstrapArgs.recurseSubmodules,
|
||||
SparseCheckout: bootstrapArgs.sparseCheckout,
|
||||
}
|
||||
|
||||
entityList, err := bootstrap.LoadEntityListFromPath(bootstrapArgs.gpgKeyRingPath)
|
||||
|
|
|
|||
|
|
@ -239,6 +239,7 @@ func bootstrapGitHubCmdRun(cmd *cobra.Command, args []string) error {
|
|||
TargetPath: githubArgs.path.ToSlash(),
|
||||
ManifestFile: sync.MakeDefaultOptions().ManifestFile,
|
||||
RecurseSubmodules: bootstrapArgs.recurseSubmodules,
|
||||
SparseCheckout: bootstrapArgs.sparseCheckout,
|
||||
}
|
||||
|
||||
entityList, err := bootstrap.LoadEntityListFromPath(bootstrapArgs.gpgKeyRingPath)
|
||||
|
|
|
|||
|
|
@ -287,6 +287,7 @@ func bootstrapGitLabCmdRun(cmd *cobra.Command, args []string) error {
|
|||
TargetPath: gitlabArgs.path.ToSlash(),
|
||||
ManifestFile: sync.MakeDefaultOptions().ManifestFile,
|
||||
RecurseSubmodules: bootstrapArgs.recurseSubmodules,
|
||||
SparseCheckout: bootstrapArgs.sparseCheckout,
|
||||
}
|
||||
|
||||
entityList, err := bootstrap.LoadEntityListFromPath(bootstrapArgs.gpgKeyRingPath)
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ type Options struct {
|
|||
ManifestFile string
|
||||
RecurseSubmodules bool
|
||||
Provider string
|
||||
SparseCheckout []string
|
||||
}
|
||||
|
||||
func MakeDefaultOptions() Options {
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ func Generate(options Options) (*manifestgen.Manifest, error) {
|
|||
},
|
||||
RecurseSubmodules: options.RecurseSubmodules,
|
||||
Provider: options.Provider,
|
||||
SparseCheckout: options.SparseCheckout,
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue