Skip to content

Commit 28ec80e

Browse files
author
Peng Zhou
committed
remove unused code and add comments
1 parent a8a0439 commit 28ec80e

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

pkg/k8sutil/haProxyHelper.go

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ func generateFrontendConfig(cr *marklogicv1.MarklogicCluster) string {
3232
pathBasedRouting := cr.Spec.HAProxy.PathBasedRouting
3333
appServers := cr.Spec.HAProxy.AppServers
3434
if *pathBasedRouting {
35+
// front end configuration for path based routing
3536
frontEndDef = `
3637
frontend marklogic-pathbased-frontend
3738
mode http
@@ -53,6 +54,7 @@ frontend marklogic-pathbased-frontend
5354
result += getFrontendForPathbased(data)
5455
}
5556
} else {
57+
// front end configuration for non-path based routing
5658
frontEndDef = `
5759
frontend marklogic-{{ .PortNumber}}
5860
mode http
@@ -247,20 +249,3 @@ func parseTemplateToString(templateStr string, data interface{}) string {
247249

248250
type Servers []marklogicv1.AppServers
249251

250-
func getPathList(servers Servers) []string {
251-
var paths []string
252-
for _, server := range servers {
253-
paths = append(paths, server.Path)
254-
}
255-
return paths
256-
}
257-
258-
// returns a array of replica numbers from 0 to replicas-1
259-
// used for looping over replicas in haproxy config
260-
func generateReplicaArray(replicas int) []int {
261-
Replicas := []int{}
262-
for i := 0; i < replicas; i++ {
263-
Replicas = append(Replicas, i)
264-
}
265-
return Replicas
266-
}

0 commit comments

Comments
 (0)