Skip to content

Commit

Permalink
Deleted debug comments
Browse files Browse the repository at this point in the history
  • Loading branch information
catttam committed Jul 25, 2024
1 parent dd2716c commit a98d86e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
5 changes: 0 additions & 5 deletions pkg/handlers/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ func MakeCreateHandler(cfg *types.Config, back types.ServerlessBackend) gin.Hand
return func(c *gin.Context) {
var service types.Service
authHeader := c.GetHeader("Authorization")
createLogger.Printf("[*] POST header : %v", authHeader)
if len(strings.Split(authHeader, "Bearer")) == 1 {
createLogger.Printf(">>> is admin")
isAdminUser = true
service.Owner = "cluster_admin"
createLogger.Printf("Creating service for user: %s", service.Owner)
Expand All @@ -68,13 +66,11 @@ func MakeCreateHandler(cfg *types.Config, back types.ServerlessBackend) gin.Hand

// Check service values and set defaults
checkValues(&service, cfg)
createLogger.Printf(">>> checked values")
// Check if users in allowed_users have a MinIO associated user
minIOAdminClient, _ := utils.MakeMinIOAdminClient(cfg)

// Service is created by an EGI user
if !isAdminUser {
createLogger.Printf(">>> not admin")
uid, err := auth.GetUIDFromContext(c)
if err != nil {
c.String(http.StatusInternalServerError, fmt.Sprintln(err))
Expand Down Expand Up @@ -136,7 +132,6 @@ func MakeCreateHandler(cfg *types.Config, back types.ServerlessBackend) gin.Hand
}

// Create the service
createLogger.Printf(">>> service uid: %s", service.Owner)
if err := back.CreateService(service); err != nil {
// Check if error is caused because the service name provided already exists
if k8sErrors.IsAlreadyExists(err) {
Expand Down
1 change: 1 addition & 0 deletions pkg/types/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ done`
ephemeralVolumeMount = "/tmpfolder"
)

// SetMount Creates the sidecar container that mounts the source volume onto the pod volume
func SetMount(podSpec *v1.PodSpec, service Service, cfg *Config) {
podSpec.Containers = append(podSpec.Containers, sidecarPodSpec(service))
termination := int64(5)
Expand Down

0 comments on commit a98d86e

Please sign in to comment.