mirror of
https://github.com/fluxcd/flux2.git
synced 2026-02-28 02:14:59 +00:00
Merge pull request #702 from fluxcd/feature/git-implementation
Add git implementation to generate sync options
This commit is contained in:
commit
884e3c678c
7 changed files with 36 additions and 28 deletions
|
|
@ -171,6 +171,7 @@ func generateSyncManifests(url, branch, name, namespace, targetPath, tmpDir stri
|
|||
Interval: interval,
|
||||
TargetPath: targetPath,
|
||||
ManifestFile: sync.MakeDefaultOptions().ManifestFile,
|
||||
GitImplementation: sync.MakeDefaultOptions().GitImplementation,
|
||||
}
|
||||
|
||||
manifest, err := sync.Generate(opts)
|
||||
|
|
|
|||
|
|
@ -16,7 +16,11 @@ limitations under the License.
|
|||
|
||||
package sync
|
||||
|
||||
import "time"
|
||||
import (
|
||||
"time"
|
||||
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1beta1"
|
||||
)
|
||||
|
||||
type Options struct {
|
||||
Interval time.Duration
|
||||
|
|
@ -26,6 +30,7 @@ type Options struct {
|
|||
Branch string
|
||||
TargetPath string
|
||||
ManifestFile string
|
||||
GitImplementation string
|
||||
}
|
||||
|
||||
func MakeDefaultOptions() Options {
|
||||
|
|
@ -37,5 +42,6 @@ func MakeDefaultOptions() Options {
|
|||
Branch: "main",
|
||||
ManifestFile: "gotk-sync.yaml",
|
||||
TargetPath: "",
|
||||
GitImplementation: sourcev1.GoGitImplementation,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ func Generate(options Options) (*manifestgen.Manifest, error) {
|
|||
SecretRef: &corev1.LocalObjectReference{
|
||||
Name: options.Name,
|
||||
},
|
||||
GitImplementation: options.GitImplementation,
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue