Skip to content

[ws-manager-mk2] Emit events for workspaces and snapshots #16907

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

Merged
merged 5 commits into from
Mar 20, 2023
Merged

Conversation

Furisto
Copy link
Member

@Furisto Furisto commented Mar 17, 2023

Description

Emit events for workspaces and snapshots. Depends on #16896

kubectl get events | rg workspace/
108s        Normal    Creating            workspace/064b1210-53d1-42df-9ac5-a00dbc60a22f                      
107s        Normal    Initializing        workspace/064b1210-53d1-42df-9ac5-a00dbc60a22f                      
104s        Normal    Running             workspace/064b1210-53d1-42df-9ac5-a00dbc60a22f                      
0s          Normal    Stopping            workspace/064b1210-53d1-42df-9ac5-a00dbc60a22f                      
0s          Normal    Deleting            workspace/064b1210-53d1-42df-9ac5-a00dbc60a22f
20m         Warning   Failed         workspace/32739418-0e1e-43a0-ba82-090050686b64    Content init failed: cannot initialize workspace: no backup found
10m         Warning   Failed         workspace/2921aee7-726a-48dd-a826-6372d3446a15    Backup failed: BOOM

`

Related Issue(s)

n.a.

How to test

Using https://g8a099d879e.workspace-preview.gitpod-io-dev.com/workspaces

  • kubectl get events
  • Start workspace
  • Take snapshot
  • Stop workspace

Release Notes

None

Build Options:

  • /werft with-werft
    Run the build with werft instead of GHA
  • leeway-no-cache
  • /werft no-test
    Run Leeway with --dont-test
Publish Options
  • /werft publish-to-npm
  • /werft publish-to-jb-marketplace
Installer Options
  • with-ee-license
  • with-dedicated-emulation
  • with-ws-manager-mk2
  • workspace-feature-flags
    Add desired feature flags to the end of the line above, space separated

Preview Environment Options:

  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-large-vm
  • /werft with-gce-vm
    If enabled this will create the environment on GCE infra
  • /werft with-integration-tests=all
    Valid options are all, workspace, webapp, ide, jetbrains, vscode, ssh

@Furisto Furisto self-assigned this Mar 17, 2023
@Furisto Furisto requested a review from a team March 17, 2023 17:11
Copy link
Member

@WVerlaek WVerlaek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is great

@@ -124,5 +128,20 @@ func (ssc *SnapshotReconciler) Reconcile(ctx context.Context, req ctrl.Request)
log.Error(err, "could not set completion status for snapshot", "workspace", snapshot.Spec.WorkspaceID)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated to the PR, but would be nice to log the snapshotErr here if it fails to update the status

@@ -114,12 +117,14 @@ func (r *WorkspaceReconciler) Reconcile(ctx context.Context, req ctrl.Request) (
return ctrl.Result{}, err
}

err = updateWorkspaceStatus(ctx, &workspace, workspacePods, r.Config)
oldStatus := workspace.Status
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
oldStatus := workspace.Status
oldStatus := workspace.Status.DeepCopy()

to ensure e.g. pointers are also copied, don't think it makes any difference now but might in the future?

@roboquat roboquat merged commit 42a3602 into main Mar 20, 2023
@roboquat roboquat deleted the fo/mk2-events branch March 20, 2023 12:59
@roboquat roboquat added deployed: workspace Workspace team change is running in production deployed Change is completely running in production labels Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: workspace Workspace team change is running in production deployed Change is completely running in production feature: ws-manager-mk2 release-note-none size/L team: workspace Issue belongs to the Workspace team
Projects
No open projects
Status: In Validation
Development

Successfully merging this pull request may close these issues.

3 participants