diff --git a/controllers/devbox/internal/controller/devbox_controller.go b/controllers/devbox/internal/controller/devbox_controller.go index 0de5776e765..b1bac8aa29e 100644 --- a/controllers/devbox/internal/controller/devbox_controller.go +++ b/controllers/devbox/internal/controller/devbox_controller.go @@ -194,10 +194,10 @@ func (r *DevboxReconciler) syncSecret(ctx context.Context, devbox *devboxv1alpha secret := &corev1.Secret{ ObjectMeta: objectMeta, Data: map[string][]byte{ - "SEALOS_DEVBOX_PASSWORD": []byte(rand.String(12)), - "SEALOS_DEVBOX_JWT_SECRET": []byte(rand.String(32)), - "SEALOS_DEVBOX_PUBLIC_KEY": publicKey, - "SEALOS_DEVBOX_PRIVATE_KEY": privateKey, + "SEALOS_DEVBOX_JWT_SECRET": []byte(rand.String(32)), + "SEALOS_DEVBOX_PUBLIC_KEY": publicKey, + "SEALOS_DEVBOX_PRIVATE_KEY": privateKey, + "SEALOS_DEVBOX_AUTHORIZED_KEYS": publicKey, }, } diff --git a/controllers/devbox/internal/controller/helper/devbox.go b/controllers/devbox/internal/controller/helper/devbox.go index eb969bc56f0..ac6e0356a3a 100644 --- a/controllers/devbox/internal/controller/helper/devbox.go +++ b/controllers/devbox/internal/controller/helper/devbox.go @@ -301,17 +301,6 @@ func GenerateDevboxEnvVars(devbox *devboxv1alpha1.Devbox, nextCommitHistory *dev Name: "SEALOS_DEVBOX_NAME", Value: devbox.Namespace + "-" + devbox.Name, }, - { - Name: "SEALOS_DEVBOX_PASSWORD", - ValueFrom: &corev1.EnvVarSource{ - SecretKeyRef: &corev1.SecretKeySelector{ - Key: "SEALOS_DEVBOX_PASSWORD", - LocalObjectReference: corev1.LocalObjectReference{ - Name: devbox.Name, - }, - }, - }, - }, { Name: "SEALOS_DEVBOX_POD_UID", ValueFrom: &corev1.EnvVarSource{ @@ -375,6 +364,10 @@ func GenerateSSHVolume(devbox *devboxv1alpha1.Devbox) corev1.Volume { Key: "SEALOS_DEVBOX_PUBLIC_KEY", Path: "id.pub", }, + { + Key: "SEALOS_DEVBOX_AUTHORIZED_KEYS", + Path: "authorized_keys", + }, }, }, },