diff --git a/cmd/flux/bootstrap.go b/cmd/flux/bootstrap.go index 0bf38de62e7e6feffb1820cecc9124350f0a7ab0..9bccfdd48eee40c13c0b20350e6a94eafa0da1fa 100644 --- a/cmd/flux/bootstrap.go +++ b/cmd/flux/bootstrap.go @@ -164,13 +164,14 @@ func applyInstallManifests(ctx context.Context, manifestPath string, components func generateSyncManifests(url, branch, name, namespace, targetPath, tmpDir string, interval time.Duration) (string, error) { opts := sync.Options{ - Name: name, - Namespace: namespace, - URL: url, - Branch: branch, - Interval: interval, - TargetPath: targetPath, - ManifestFile: sync.MakeDefaultOptions().ManifestFile, + Name: name, + Namespace: namespace, + URL: url, + Branch: branch, + Interval: interval, + TargetPath: targetPath, + ManifestFile: sync.MakeDefaultOptions().ManifestFile, + GitImplementation: sync.MakeDefaultOptions().GitImplementation, } manifest, err := sync.Generate(opts) diff --git a/cmd/flux/bootstrap_github.go b/cmd/flux/bootstrap_github.go index a0e808d9ad6f1da1b556fa3df74857826052282d..336423de7fb8a585401636c07b3282be9a7b3502 100644 --- a/cmd/flux/bootstrap_github.go +++ b/cmd/flux/bootstrap_github.go @@ -57,7 +57,7 @@ the bootstrap command will perform an upgrade if needed.`, flux bootstrap github --owner=<organization> --repository=<repo name> --path=dev-cluster # Run bootstrap for a public repository on a personal account - flux bootstrap github --owner=<user> --repository=<repo name> --private=false --personal=true + flux bootstrap github --owner=<user> --repository=<repo name> --private=false --personal=true # Run bootstrap for a private repo hosted on GitHub Enterprise using SSH auth flux bootstrap github --owner=<organization> --repository=<repo name> --hostname=<domain> --ssh-hostname=<domain> diff --git a/cmd/flux/bootstrap_gitlab.go b/cmd/flux/bootstrap_gitlab.go index c2b0b60987a58b57dbdd8c5bd2fcd40fdb697495..dbbc5793dec2f2a0eeaae1b3952ff8ac27b58a21 100644 --- a/cmd/flux/bootstrap_gitlab.go +++ b/cmd/flux/bootstrap_gitlab.go @@ -48,7 +48,7 @@ the bootstrap command will perform an upgrade if needed.`, Example: ` # Create a GitLab API token and export it as an env var export GITLAB_TOKEN=<my-token> - # Run bootstrap for a private repo using HTTPS token authentication + # Run bootstrap for a private repo using HTTPS token authentication flux bootstrap gitlab --owner=<group> --repository=<repo name> --token-auth # Run bootstrap for a private repo using SSH authentication @@ -60,7 +60,7 @@ the bootstrap command will perform an upgrade if needed.`, # Run bootstrap for a public repository on a personal account flux bootstrap gitlab --owner=<user> --repository=<repo name> --private=false --personal --token-auth - # Run bootstrap for a private repo hosted on a GitLab server + # Run bootstrap for a private repo hosted on a GitLab server flux bootstrap gitlab --owner=<group> --repository=<repo name> --hostname=<domain> --token-auth # Run bootstrap for a an existing repository with a branch named main diff --git a/docs/cmd/flux_bootstrap_github.md b/docs/cmd/flux_bootstrap_github.md index 2836d3466c9910aa43c24d3f28c5d26b2b45f93a..784579e3d67df64efb4ce4a6c6a0cf470e8fa04b 100644 --- a/docs/cmd/flux_bootstrap_github.md +++ b/docs/cmd/flux_bootstrap_github.md @@ -30,7 +30,7 @@ flux bootstrap github [flags] flux bootstrap github --owner=<organization> --repository=<repo name> --path=dev-cluster # Run bootstrap for a public repository on a personal account - flux bootstrap github --owner=<user> --repository=<repo name> --private=false --personal=true + flux bootstrap github --owner=<user> --repository=<repo name> --private=false --personal=true # Run bootstrap for a private repo hosted on GitHub Enterprise using SSH auth flux bootstrap github --owner=<organization> --repository=<repo name> --hostname=<domain> --ssh-hostname=<domain> diff --git a/docs/cmd/flux_bootstrap_gitlab.md b/docs/cmd/flux_bootstrap_gitlab.md index 399c8370528a3b9016f168d75f9cfad1d1455e37..3df2f26e82300304ec6e6d298daf4f3f015aec21 100644 --- a/docs/cmd/flux_bootstrap_gitlab.md +++ b/docs/cmd/flux_bootstrap_gitlab.md @@ -20,7 +20,7 @@ flux bootstrap gitlab [flags] # Create a GitLab API token and export it as an env var export GITLAB_TOKEN=<my-token> - # Run bootstrap for a private repo using HTTPS token authentication + # Run bootstrap for a private repo using HTTPS token authentication flux bootstrap gitlab --owner=<group> --repository=<repo name> --token-auth # Run bootstrap for a private repo using SSH authentication @@ -32,7 +32,7 @@ flux bootstrap gitlab [flags] # Run bootstrap for a public repository on a personal account flux bootstrap gitlab --owner=<user> --repository=<repo name> --private=false --personal --token-auth - # Run bootstrap for a private repo hosted on a GitLab server + # Run bootstrap for a private repo hosted on a GitLab server flux bootstrap gitlab --owner=<group> --repository=<repo name> --hostname=<domain> --token-auth # Run bootstrap for a an existing repository with a branch named main diff --git a/pkg/manifestgen/sync/options.go b/pkg/manifestgen/sync/options.go index 411612af64f38abf42d0efd0b627132b4fe40aac..4fb5955a6507f1da75ba57d2ad4a2a61c1a7e84f 100644 --- a/pkg/manifestgen/sync/options.go +++ b/pkg/manifestgen/sync/options.go @@ -16,26 +16,32 @@ limitations under the License. package sync -import "time" +import ( + "time" + + sourcev1 "github.com/fluxcd/source-controller/api/v1beta1" +) type Options struct { - Interval time.Duration - URL string - Name string - Namespace string - Branch string - TargetPath string - ManifestFile string + Interval time.Duration + URL string + Name string + Namespace string + Branch string + TargetPath string + ManifestFile string + GitImplementation string } func MakeDefaultOptions() Options { return Options{ - Interval: 1 * time.Minute, - URL: "", - Name: "flux-system", - Namespace: "flux-system", - Branch: "main", - ManifestFile: "gotk-sync.yaml", - TargetPath: "", + Interval: 1 * time.Minute, + URL: "", + Name: "flux-system", + Namespace: "flux-system", + Branch: "main", + ManifestFile: "gotk-sync.yaml", + TargetPath: "", + GitImplementation: sourcev1.GoGitImplementation, } } diff --git a/pkg/manifestgen/sync/sync.go b/pkg/manifestgen/sync/sync.go index 840d8498ee21a82f3ab26d1ccc02d40f8bd37f95..d112f6dd9355113dd1e88ce46e88ce2c196b7894 100644 --- a/pkg/manifestgen/sync/sync.go +++ b/pkg/manifestgen/sync/sync.go @@ -55,6 +55,7 @@ func Generate(options Options) (*manifestgen.Manifest, error) { SecretRef: &corev1.LocalObjectReference{ Name: options.Name, }, + GitImplementation: options.GitImplementation, }, }