Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add devbox node and containerId #5045

Merged
merged 2 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions controllers/devbox/api/v1alpha1/devbox_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2732,8 +2732,12 @@ spec:
commitHistory:
items:
properties:
containerID:
type: string
image:
type: string
node:
type: string
pod:
type: string
status:
Expand All @@ -2742,7 +2746,9 @@ spec:
format: date-time
type: string
required:
- containerID
- image
- node
- pod
- status
- time
Expand Down
6 changes: 6 additions & 0 deletions controllers/devbox/deploy/manifests/deploy.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2740,8 +2740,12 @@ spec:
commitHistory:
items:
properties:
containerID:
type: string
image:
type: string
node:
type: string
pod:
type: string
status:
Expand All @@ -2750,7 +2754,9 @@ spec:
format: date-time
type: string
required:
- containerID
- image
- node
- pod
- status
- time
Expand Down
3 changes: 3 additions & 0 deletions controllers/devbox/internal/controller/devbox_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Loading