@@ -52,16 +52,17 @@ import (
52
52
53
53
type (
54
54
GitSourceCreateOptions struct {
55
- InsCloneOpts * git.CloneOptions
56
- GsCloneOpts * git.CloneOptions
57
- GsName string
58
- RuntimeName string
59
- CreateDemoResources bool
60
- Exclude string
61
- Include string
62
- HostName string
63
- IngressHost string
64
- IngressClass string
55
+ InsCloneOpts * git.CloneOptions
56
+ GsCloneOpts * git.CloneOptions
57
+ GsName string
58
+ RuntimeName string
59
+ CreateDemoResources bool
60
+ Exclude string
61
+ Include string
62
+ HostName string
63
+ IngressHost string
64
+ IngressClass string
65
+ IngressControllerType ingressControllerType
65
66
}
66
67
67
68
GitSourceDeleteOptions struct {
@@ -85,12 +86,13 @@ type (
85
86
}
86
87
87
88
gitSourceGithubExampleOptions struct {
88
- runtimeName string
89
- gsCloneOpts * git.CloneOptions
90
- gsFs fs.FS
91
- hostName string
92
- ingressHost string
93
- ingressClass string
89
+ runtimeName string
90
+ gsCloneOpts * git.CloneOptions
91
+ gsFs fs.FS
92
+ hostName string
93
+ ingressHost string
94
+ ingressClass string
95
+ ingressControllerType ingressControllerType
94
96
}
95
97
96
98
dirConfig struct {
@@ -252,12 +254,13 @@ func createDemoResources(ctx context.Context, opts *GitSourceCreateOptions, gsRe
252
254
}
253
255
254
256
err = createGithubExamplePipeline (& gitSourceGithubExampleOptions {
255
- runtimeName : opts .RuntimeName ,
256
- gsCloneOpts : opts .GsCloneOpts ,
257
- gsFs : gsFs ,
258
- hostName : opts .HostName ,
259
- ingressHost : opts .IngressHost ,
260
- ingressClass : opts .IngressClass ,
257
+ runtimeName : opts .RuntimeName ,
258
+ gsCloneOpts : opts .GsCloneOpts ,
259
+ gsFs : gsFs ,
260
+ hostName : opts .HostName ,
261
+ ingressHost : opts .IngressHost ,
262
+ ingressClass : opts .IngressClass ,
263
+ ingressControllerType : opts .IngressControllerType ,
261
264
})
262
265
if err != nil {
263
266
return fmt .Errorf ("failed to create github example pipeline. Error: %w" , err )
@@ -730,7 +733,7 @@ func createDemoWorkflowTemplate(gsFs fs.FS) error {
730
733
func createGithubExamplePipeline (opts * gitSourceGithubExampleOptions ) error {
731
734
if ! store .Get ().SkipIngress {
732
735
// Create an ingress that will manage external access to the github eventsource service
733
- ingress := createGithubExampleIngress (opts .ingressClass , opts .ingressHost , opts .hostName )
736
+ ingress := createGithubExampleIngress (opts .ingressClass , opts .ingressHost , opts .hostName , opts . ingressControllerType )
734
737
ingressFilePath := opts .gsFs .Join (opts .gsCloneOpts .Path (), store .Get ().GithubExampleIngressFileName )
735
738
736
739
ingressRedundanded , err := cleanUpFieldsIngressGithub (& ingress )
@@ -783,8 +786,8 @@ func createGithubExamplePipeline(opts *gitSourceGithubExampleOptions) error {
783
786
return nil
784
787
}
785
788
786
- func createGithubExampleIngress (ingressClass string , ingressHost string , hostName string ) * netv1.Ingress {
787
- return ingressutil . CreateIngress ( & ingressutil.CreateIngressOptions {
789
+ func createGithubExampleIngress (ingressClass string , ingressHost string , hostName string , ingressControllerType ingressControllerType ) * netv1.Ingress {
790
+ ingressOptions := ingressutil.CreateIngressOptions {
788
791
Name : store .Get ().CodefreshDeliveryPipelines ,
789
792
IngressClassName : ingressClass ,
790
793
Host : hostName ,
@@ -795,7 +798,15 @@ func createGithubExampleIngress(ingressClass string, ingressHost string, hostNam
795
798
ServiceName : store .Get ().GithubExampleEventSourceObjectName + "-eventsource-svc" ,
796
799
ServicePort : store .Get ().GithubExampleEventSourceServicePort ,
797
800
},
798
- }})
801
+ }}
802
+
803
+ if ingressControllerType == IngressControllerNginxEnterprise {
804
+ ingressOptions .Annotations = map [string ]string {
805
+ "nginx.org/mergeable-ingress-type" : "minion" ,
806
+ }
807
+ }
808
+
809
+ return ingressutil .CreateIngress (& ingressOptions )
799
810
}
800
811
801
812
func getRepoOwnerAndNameFromRepoURL (repoURL string ) (owner string , name string ) {
0 commit comments