Skip to content

Commit

Permalink
Merge pull request #531 from xiaoyu74/fix_ci_build
Browse files Browse the repository at this point in the history
Fix the golang-lint issue
  • Loading branch information
openshift-merge-bot[bot] authored Sep 30, 2024
2 parents 2fe6b30 + 66bff68 commit 10a2781
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ GO_BUILD_FLAGS :=-tags 'include_gcs include_oss containers_image_openpgp gssapi'
GO_BUILD_FLAGS_DARWIN :=-tags 'include_gcs include_oss containers_image_openpgp'
GO_BUILD_FLAGS_LINUX_CROSS :=-tags 'include_gcs include_oss containers_image_openpgp'

GOLANGCI_LINT_VERSION=v1.52.2
GOLANGCI_LINT_VERSION=v1.61.0
GORELEASER_VERSION=v1.14.1
GOVULNCHECK_VERSION=v1.0.1

Expand Down
8 changes: 4 additions & 4 deletions pkg/healthcheck/check_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func CheckProxyConnectivity(client HTTPClient) (string, error) {
if proxyURL == nil || *proxyURL == "" {
errMsg := "no proxy URL configured in backplane configuration"
logger.Warn(errMsg)
return "", fmt.Errorf(errMsg)
return "", fmt.Errorf("%s", errMsg)
}

logger.Infof("Getting the working proxy URL ['%s'] from local backplane configuration.", *proxyURL)
Expand Down Expand Up @@ -53,8 +53,8 @@ func CheckProxyConnectivity(client HTTPClient) (string, error) {
logger.Infof("Testing connectivity to the pre-defined test endpoint ['%s'] with the proxy.", proxyTestEndpoint)
if err := testEndPointConnectivity(proxyTestEndpoint, httpClientWithProxy); err != nil {
errMsg := fmt.Sprintf("Failed to access target endpoint ['%s'] with the proxy: %v", proxyTestEndpoint, err)
logger.Errorf(errMsg)
return "", fmt.Errorf(errMsg)
logger.Errorf("%s", errMsg)
return "", fmt.Errorf("%s", errMsg)
}

logger.Debugf("Successfully connected to proxy test endpoint: %s", proxyTestEndpoint)
Expand All @@ -70,7 +70,7 @@ func GetProxyTestEndpoint() (string, error) {
if bpConfig.ProxyCheckEndpoint == "" {
errMsg := "proxy test endpoint not configured"
logger.Warn(errMsg)
return "", fmt.Errorf(errMsg)
return "", fmt.Errorf("%s", errMsg)
}
return bpConfig.ProxyCheckEndpoint, nil
}
8 changes: 4 additions & 4 deletions pkg/healthcheck/check_vpn.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func CheckVPNConnectivity(netInterfaces NetworkInterface, client HTTPClient) err
if !vpnConnected {
errMsg := fmt.Sprintf("No VPN interfaces found: %v", vpnInterfaces)
logger.Warn(errMsg)
return fmt.Errorf(errMsg)
return fmt.Errorf("%s", errMsg)
}

vpnCheckEndpoint, err := GetVPNCheckEndpointFunc()
Expand All @@ -43,8 +43,8 @@ func CheckVPNConnectivity(netInterfaces NetworkInterface, client HTTPClient) err
}
if err := testEndPointConnectivity(vpnCheckEndpoint, client); err != nil {
errMsg := fmt.Sprintf("Failed to access internal URL %s: %v", vpnCheckEndpoint, err)
logger.Errorf(errMsg)
return fmt.Errorf(errMsg)
logger.Errorf("%s", errMsg)
return fmt.Errorf("%s", errMsg)
}

return nil
Expand All @@ -59,7 +59,7 @@ func GetVPNCheckEndpoint() (string, error) {
if bpConfig.VPNCheckEndpoint == "" {
errMsg := "VPN check endpoint not configured"
logger.Warn(errMsg)
return "", fmt.Errorf(errMsg)
return "", fmt.Errorf("%s", errMsg)
}
return bpConfig.VPNCheckEndpoint, nil
}
2 changes: 1 addition & 1 deletion pkg/healthcheck/connectivity_checks.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func testEndPointConnectivity(testURL string, client HTTPClient) error {
if resp.StatusCode != http.StatusOK {
errMsg := fmt.Sprintf("Unexpected status code: %v", resp.StatusCode)
logger.Error(errMsg)
return fmt.Errorf(errMsg)
return fmt.Errorf("%s", errMsg)
}
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/monitoring/monitoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func (c Client) RunMonitoring(monitoringType string) error {

if resp.StatusCode >= 400 {
responseBody, _ := io.ReadAll(resp.Body)
return fmt.Errorf(string(responseBody))
return fmt.Errorf("%s", string(responseBody))
}

// If the above test pass, we will construct a reverse proxy for the user
Expand Down

0 comments on commit 10a2781

Please sign in to comment.