@@ -168,7 +168,7 @@ occurs on every start of the container set FLEET_FORCE to 1.
168168}
169169
170170func logError (streams * cli.IOStreams , err error ) {
171- fmt .Fprintf (streams .Err , "Error: %v\n %s\n " , err , troubleshootMessage () )
171+ fmt .Fprintf (streams .Err , "Error: %v\n %s\n " , err , troubleshootMessage )
172172}
173173
174174func logInfo (streams * cli.IOStreams , a ... interface {}) {
@@ -409,7 +409,7 @@ func ensureServiceToken(streams *cli.IOStreams, cfg *setupConfig) error {
409409 if err != nil {
410410 return err
411411 }
412- code , r , err := client .Connection . Request ("POST" , "/api/fleet/service_tokens" , nil , nil , nil )
412+ code , r , err := client .Request ("POST" , "/api/fleet/service_tokens" , nil , nil , nil )
413413 if err != nil {
414414 return fmt .Errorf ("request to get security token from Kibana failed: %w" , err )
415415 }
@@ -712,14 +712,14 @@ func isTrue(val string) bool {
712712func performGET (cfg setupConfig , client * kibana.Client , path string , response interface {}, writer io.Writer , msg string ) error {
713713 var lastErr error
714714 for i := 0 ; i < cfg .Kibana .RetryMaxCount ; i ++ {
715- code , result , err := client .Connection . Request ("GET" , path , nil , nil , nil )
715+ code , result , err := client .Request ("GET" , path , nil , nil , nil )
716716 if err != nil || code != 200 {
717717 if err != nil {
718718 err = fmt .Errorf ("http GET request to %s%s fails: %w. Response: %s" ,
719- client .Connection . URL , path , err , truncateString (result ))
719+ client .URL , path , err , truncateString (result ))
720720 } else {
721721 err = fmt .Errorf ("http GET request to %s%s fails. StatusCode: %d Response: %s" ,
722- client .Connection . URL , path , code , truncateString (result ))
722+ client .URL , path , code , truncateString (result ))
723723 }
724724 fmt .Fprintf (writer , "%s failed: %s\n " , msg , err )
725725 <- time .After (cfg .Kibana .RetrySleepDuration )
@@ -740,7 +740,7 @@ func truncateString(b []byte) string {
740740 runes = append (runes [:maxLength ], []rune ("... (truncated)" )... )
741741 }
742742
743- return strings .Replace (string (runes ), "\n " , " " , - 1 )
743+ return strings .ReplaceAll (string (runes ), "\n " , " " )
744744}
745745
746746// runLegacyAPMServer extracts the bundled apm-server from elastic-agent
0 commit comments