Skip to content

Commit 0860e61

Browse files
committed
Move the contain func-
Signed-off-by: lubronzhan <[email protected]>
1 parent 35e410d commit 0860e61

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

internal/provisioner/objects/deployment/deployment.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,15 @@ func DesiredDeployment(contour *model.Contour, image string) *appsv1.Deployment
101101
args = append(args, "--debug")
102102
}
103103

104+
contains := func(elements []string, v string) bool {
105+
for _, a := range elements {
106+
if a == v {
107+
return true
108+
}
109+
}
110+
return false
111+
}
112+
104113
if contour.Spec.WatchNamespaces != nil && len(contour.Spec.WatchNamespaces) > 0 && !contains(contour.Spec.WatchNamespaces, corev1.NamespaceAll) {
105114
args = append(args, fmt.Sprintf("--watch-namespaces=%s", strings.Join(contour.Spec.WatchNamespaces, ",")))
106115
}
@@ -330,12 +339,3 @@ func contourPodAnnotations(contour *model.Contour) map[string]string {
330339

331340
return annotations
332341
}
333-
334-
func contains(s []string, e string) bool {
335-
for _, a := range s {
336-
if a == e {
337-
return true
338-
}
339-
}
340-
return false
341-
}

0 commit comments

Comments
 (0)