Add git implementation to generate sync options

Signed-off-by: Philip Laine <philip.laine@gmail.com>
pull/702/head
Philip Laine
parent ad9b0ae067
commit d236a9af57

@ -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)

@ -19,23 +19,25 @@ package sync
import "time"
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: "go-git",
}
}

@ -55,6 +55,7 @@ func Generate(options Options) (*manifestgen.Manifest, error) {
SecretRef: &corev1.LocalObjectReference{
Name: options.Name,
},
GitImplementation: options.GitImplementation,
},
}

Loading…
Cancel
Save