Skip to content

Commit

Permalink
add SEALOS_DEVBOX_INIT env.
Browse files Browse the repository at this point in the history
  • Loading branch information
lingdie committed Oct 31, 2024
1 parent e6a2f8b commit 87e5ba0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions controllers/devbox/internal/controller/helper/devbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,11 @@ func GenerateDevboxEnvVars(devbox *devboxv1alpha1.Devbox, nextCommitHistory *dev
}
}

initialized := false
if GetLastSuccessCommitHistory(devbox) != nil {
initialized = true
}

return []corev1.EnvVar{
{
Name: "SEALOS_COMMIT_ON_STOP",
Expand All @@ -293,6 +298,10 @@ func GenerateDevboxEnvVars(devbox *devboxv1alpha1.Devbox, nextCommitHistory *dev
Name: "SEALOS_COMMIT_IMAGE_NAME",
Value: nextCommitHistory.Image,
},
{
Name: "SEALOS_DEVBOX_INIT",
Value: fmt.Sprintf("%v", initialized),
},
{
Name: "SEALOS_COMMIT_IMAGE_SQUASH",
Value: fmt.Sprintf("%v", doSquash),
Expand Down

0 comments on commit 87e5ba0

Please sign in to comment.