@@ -18,8 +18,8 @@ import (
1818 "github.com/netobserv/network-observability-console-plugin/pkg/utils"
1919)
2020
21- func GetNamespaces (cfg loki.Config ) func (w http.ResponseWriter , r * http.Request ) {
22- lokiClient := newLokiClient (& cfg )
21+ func GetNamespaces (cfg * loki.Config ) func (w http.ResponseWriter , r * http.Request ) {
22+ lokiClient := newLokiClient (cfg )
2323 return func (w http.ResponseWriter , r * http.Request ) {
2424 var code int
2525 startTime := time .Now ()
@@ -31,14 +31,14 @@ func GetNamespaces(cfg loki.Config) func(w http.ResponseWriter, r *http.Request)
3131 values := []string {}
3232
3333 // Fetch and merge values for SrcK8S_Namespace and DstK8S_Namespace
34- values1 , code , err := getLabelValues (& cfg , lokiClient , fields .SrcNamespace )
34+ values1 , code , err := getLabelValues (cfg , lokiClient , fields .SrcNamespace )
3535 if err != nil {
3636 writeError (w , code , "Error while fetching label source namespace values from Loki: " + err .Error ())
3737 return
3838 }
3939 values = append (values , values1 ... )
4040
41- values2 , code , err := getLabelValues (& cfg , lokiClient , fields .DstNamespace )
41+ values2 , code , err := getLabelValues (cfg , lokiClient , fields .DstNamespace )
4242 if err != nil {
4343 writeError (w , code , "Error while fetching label destination namespace values from Loki: " + err .Error ())
4444 return
@@ -72,8 +72,8 @@ func getLabelValues(cfg *loki.Config, lokiClient httpclient.Caller, label string
7272 return lvr .Data , http .StatusOK , nil
7373}
7474
75- func GetNames (cfg loki.Config ) func (w http.ResponseWriter , r * http.Request ) {
76- lokiClient := newLokiClient (& cfg )
75+ func GetNames (cfg * loki.Config ) func (w http.ResponseWriter , r * http.Request ) {
76+ lokiClient := newLokiClient (cfg )
7777 return func (w http.ResponseWriter , r * http.Request ) {
7878 var code int
7979 startTime := time .Now ()
@@ -107,7 +107,7 @@ func GetNames(cfg loki.Config) func(w http.ResponseWriter, r *http.Request) {
107107 }
108108}
109109
110- func getNamesForPrefix (cfg loki.Config , lokiClient httpclient.Caller , prefix , kind , namespace string ) ([]string , int , error ) {
110+ func getNamesForPrefix (cfg * loki.Config , lokiClient httpclient.Caller , prefix , kind , namespace string ) ([]string , int , error ) {
111111 lokiParams := [][]string {}
112112 if namespace != "" {
113113 lokiParams = append (lokiParams , []string {prefix + fields .Namespace , exact (namespace )})
@@ -121,7 +121,7 @@ func getNamesForPrefix(cfg loki.Config, lokiClient httpclient.Caller, prefix, ki
121121 fieldToExtract = prefix + fields .Name
122122 }
123123
124- queryBuilder := loki .NewFlowQueryBuilderWithDefaults (& cfg )
124+ queryBuilder := loki .NewFlowQueryBuilderWithDefaults (cfg )
125125 if err := queryBuilder .Filters (lokiParams ); err != nil {
126126 return nil , http .StatusBadRequest , err
127127 }
0 commit comments