Skip to content

Commit

Permalink
feat:websocket auto shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
bearslyricattack committed Dec 13, 2024
1 parent 8b9c373 commit 031cb18
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions controllers/devbox/internal/controller/devbox_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -605,14 +605,13 @@ func (r *DevboxReconciler) generateProxyPodJWT(ctx context.Context, devbox *devb
},
}
token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims)
fmt.Printf("生成的token为:%s\n", token)
return token.SignedString(r.ShutdownServerKey)
}

func (r *DevboxReconciler) generateProxyPodEnv(ctx context.Context, devbox *devboxv1alpha1.Devbox, servicePorts []corev1.ServicePort) []corev1.EnvVar {
var envVars []corev1.EnvVar
autoShutdownEnabled := devbox.Spec.AutoShutdownSpec.Enable && r.EnableAutoShutdown
fmt.Println(devbox.Spec.AutoShutdownSpec.Enable)
fmt.Println(r.EnableAutoShutdown)
envVars = append(envVars, corev1.EnvVar{
Name: "ENABLE_AUTO_SHUTDOWN",
Value: strconv.FormatBool(autoShutdownEnabled),
Expand Down

0 comments on commit 031cb18

Please sign in to comment.