@@ -16,6 +16,15 @@ func TemplateStoreListToDTO(store []v1alpha1.TemplateStore) []dto.TemplateStore
1616 iconURL = templateStore .GetAnnotations ()[v1alpha1 .IconURLAnnotation ]
1717 }
1818
19+ var enforceGitOpsWrite * dto.GitOpsWrite
20+ if templateStore .Spec .EnforceGitOpsWrite != nil {
21+ enforceGitOpsWrite = & dto.GitOpsWrite {
22+ Repo : templateStore .Spec .EnforceGitOpsWrite .Repo ,
23+ Path : templateStore .Spec .EnforceGitOpsWrite .Path ,
24+ Branch : templateStore .Spec .EnforceGitOpsWrite .Version ,
25+ }
26+ }
27+
1928 out = append (out , dto.TemplateStore {
2029 Name : templateStore .Name ,
2130 IconURL : iconURL ,
@@ -25,13 +34,23 @@ func TemplateStoreListToDTO(store []v1alpha1.TemplateStore) []dto.TemplateStore
2534 Version : templateStore .Spec .Version ,
2635 SourceType : string (templateStore .Spec .SourceType ),
2736 },
37+ EnforceGitOpsWrite : enforceGitOpsWrite ,
2838 })
2939 }
3040
3141 return out
3242}
3343
3444func DTOToTemplateStore (store dto.TemplateStore , iconURL string ) * v1alpha1.TemplateStore {
45+ var enforceGitOpsWrite * v1alpha1.GitOpsWriteDestination
46+ if store .EnforceGitOpsWrite != nil {
47+ enforceGitOpsWrite = & v1alpha1.GitOpsWriteDestination {
48+ Repo : store .EnforceGitOpsWrite .Repo ,
49+ Path : store .EnforceGitOpsWrite .Path ,
50+ Version : store .EnforceGitOpsWrite .Branch ,
51+ }
52+ }
53+
3554 return & v1alpha1.TemplateStore {
3655 TypeMeta : metav1.TypeMeta {
3756 Kind : "TemplateStore" ,
@@ -44,10 +63,11 @@ func DTOToTemplateStore(store dto.TemplateStore, iconURL string) *v1alpha1.Templ
4463 },
4564 },
4665 Spec : v1alpha1.TemplateRef {
47- URL : store .TemplateRef .URL ,
48- Path : store .TemplateRef .Path ,
49- Version : store .TemplateRef .Version ,
50- SourceType : v1alpha1 .TemplateSourceType (store .TemplateRef .SourceType ),
66+ URL : store .TemplateRef .URL ,
67+ Path : store .TemplateRef .Path ,
68+ Version : store .TemplateRef .Version ,
69+ SourceType : v1alpha1 .TemplateSourceType (store .TemplateRef .SourceType ),
70+ EnforceGitOpsWrite : enforceGitOpsWrite ,
5171 },
5272 }
5373}
0 commit comments