diff --git a/controllers/devbox/api/v1alpha1/devbox_types.go b/controllers/devbox/api/v1alpha1/devbox_types.go index 636a2974a19..20c6f64d40c 100644 --- a/controllers/devbox/api/v1alpha1/devbox_types.go +++ b/controllers/devbox/api/v1alpha1/devbox_types.go @@ -135,10 +135,12 @@ const ( ) type CommitHistory struct { - Image string `json:"image"` - Time metav1.Time `json:"time"` - Pod string `json:"pod"` - Status CommitStatus `json:"status"` + Image string `json:"image"` + Time metav1.Time `json:"time"` + Pod string `json:"pod"` + Status CommitStatus `json:"status"` + Node string `json:"node"` + ContainerID string `json:"containerID"` } type DevboxPhase string diff --git a/controllers/devbox/config/crd/bases/devbox.sealos.io_devboxes.yaml b/controllers/devbox/config/crd/bases/devbox.sealos.io_devboxes.yaml index 26ff39819b5..fee188a0e1e 100644 --- a/controllers/devbox/config/crd/bases/devbox.sealos.io_devboxes.yaml +++ b/controllers/devbox/config/crd/bases/devbox.sealos.io_devboxes.yaml @@ -2732,8 +2732,12 @@ spec: commitHistory: items: properties: + containerID: + type: string image: type: string + node: + type: string pod: type: string status: @@ -2742,7 +2746,9 @@ spec: format: date-time type: string required: + - containerID - image + - node - pod - status - time diff --git a/controllers/devbox/deploy/manifests/deploy.yaml.tmpl b/controllers/devbox/deploy/manifests/deploy.yaml.tmpl index 827483b0e65..940befc1709 100644 --- a/controllers/devbox/deploy/manifests/deploy.yaml.tmpl +++ b/controllers/devbox/deploy/manifests/deploy.yaml.tmpl @@ -2740,8 +2740,12 @@ spec: commitHistory: items: properties: + containerID: + type: string image: type: string + node: + type: string pod: type: string status: @@ -2750,7 +2754,9 @@ spec: format: date-time type: string required: + - containerID - image + - node - pod - status - time diff --git a/controllers/devbox/internal/controller/devbox_controller.go b/controllers/devbox/internal/controller/devbox_controller.go index d180b50f803..fd1badd4e30 100644 --- a/controllers/devbox/internal/controller/devbox_controller.go +++ b/controllers/devbox/internal/controller/devbox_controller.go @@ -397,6 +397,9 @@ func (r *DevboxReconciler) updateDevboxCommitHistory(ctx context.Context, devbox // based on pod status, update commit history status if commitSuccess(pod.Status.Phase) { devbox.Status.CommitHistory[i].Status = devboxv1alpha1.CommitStatusSuccess + //update node and containerId + devbox.Status.CommitHistory[i].Node = pod.Spec.NodeName + devbox.Status.CommitHistory[i].ContainerID = pod.Status.ContainerStatuses[0].ContainerID } else { devbox.Status.CommitHistory[i].Status = devboxv1alpha1.CommitStatusFailed }