Skip to content

Commit

Permalink
Fix staticcheck issues
Browse files Browse the repository at this point in the history
  • Loading branch information
micafer committed Nov 25, 2024
1 parent 3c3c100 commit 2dab7cc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
5 changes: 2 additions & 3 deletions pkg/backends/knative.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"fmt"
"log"
"net/http"
"os"
"strconv"

"github.com/grycap/oscar/v3/pkg/imagepuller"
Expand All @@ -33,8 +32,8 @@ import (
knclientset "knative.dev/serving/pkg/client/clientset/versioned"
)

// Custom logger
var knativeLogger = log.New(os.Stdout, "[KNATIVE] ", log.Flags())
// Custom logger - uncomment if needed
// var knativeLogger = log.New(os.Stdout, "[KNATIVE] ", log.Flags())

// KnativeBackend struct to represent a Knative client
type KnativeBackend struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/handlers/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func MakeJobHandler(cfg *types.Config, kubeClientset kubernetes.Interface, back
c.Next()

// Initialize event envVar and args var
event := v1.EnvVar{}
var event v1.EnvVar
var args []string

if cfg.InterLinkAvailable && service.InterLinkNodeName != "" {
Expand Down
8 changes: 4 additions & 4 deletions pkg/utils/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,23 +110,23 @@ func GetLoggerMiddleware() gin.HandlerFunc {
func GetUIDFromContext(c *gin.Context) (string, error) {
uidOrigin, uidExists := c.Get("uidOrigin")
if !uidExists {
return "", fmt.Errorf("Missing EGI user uid")
return "", fmt.Errorf("missing EGI user uid")
}
uid, uidParsed := uidOrigin.(string)
if !uidParsed {
return "", fmt.Errorf("Error parsing uid origin: %v", uidParsed)
return "", fmt.Errorf("error parsing uid origin: %v", uidParsed)
}
return uid, nil
}

func GetMultitenancyConfigFromContext(c *gin.Context) (*MultitenancyConfig, error) {
mcUntyped, mcExists := c.Get("multitenancyConfig")
if !mcExists {
return nil, fmt.Errorf("Missing multitenancy config")
return nil, fmt.Errorf("missing multitenancy config")
}
mc, mcParsed := mcUntyped.(*MultitenancyConfig)
if !mcParsed {
return nil, fmt.Errorf("Error parsing multitenancy config")
return nil, fmt.Errorf("error parsing multitenancy config")
}
return mc, nil
}
5 changes: 2 additions & 3 deletions pkg/utils/minio.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@ import (
"crypto/tls"
"encoding/json"
"fmt"
"log"
"net/http"
"net/url"
"os"
"time"

"github.com/grycap/oscar/v3/pkg/types"
Expand All @@ -33,7 +31,8 @@ import (

const ALL_USERS_GROUP = "all_users_group"

var minioLogger = log.New(os.Stdout, "[MINIO] ", log.Flags())
// Custom logger - uncomment if needed
// var minioLogger = log.New(os.Stdout, "[MINIO] ", log.Flags())

// MinIOAdminClient struct to represent a MinIO Admin client to configure webhook notifications
type MinIOAdminClient struct {
Expand Down

0 comments on commit 2dab7cc

Please sign in to comment.