Skip to content

Commit

Permalink
[Chore] open noctx and gosec linter
Browse files Browse the repository at this point in the history
Signed-off-by: yandongxiao <[email protected]>
  • Loading branch information
yandongxiao committed Nov 29, 2023
1 parent 6fb5cce commit 3ffe799
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
6 changes: 4 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ linters:
# - goimports
- gomnd
- goprintffuncname
#- gosec
- gosec
- gosimple
- govet
- ineffassign
- lll
- misspell
- nakedret
#- noctx
- noctx
- nolintlint
- revive
- staticcheck
Expand Down Expand Up @@ -153,6 +153,8 @@ issues:

run:
timeout: 5m
skip-files:
- ".*_test\\.go"
skip-dirs:
- test/testdata_etc # test files
- internal/cache # extracted from Go code
Expand Down
11 changes: 10 additions & 1 deletion pkg/sub_controller/cn/cn_pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package cn

import (
"context"
"encoding/json"
"fmt"
"io"
Expand Down Expand Up @@ -128,7 +129,15 @@ func (cc *CnController) buildPodTemplate(object srobject.StarRocksObject,
// }
func (cc *CnController) addWarehouseEnv(feExternalServiceName string, feHTTPPort string) bool {
klog.Infof("call FE to get features information")
resp, err := http.Get(fmt.Sprintf("http://%s:%s/api/v2/feature", feExternalServiceName, feHTTPPort))

req, err := http.NewRequestWithContext(context.Background(), "GET",
fmt.Sprintf("http://%s:%s/api/v2/feature", feExternalServiceName, feHTTPPort), nil)
if err != nil {
klog.Errorf("failed to create request: %v", err)
return false
}
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
klog.Errorf("failed to get features information from FE, err: %v", err)
return false
Expand Down

0 comments on commit 3ffe799

Please sign in to comment.