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

[gpctl] add command to get last heartbeat time of workspace #11230

Merged
merged 1 commit into from
Jul 8, 2022
Merged

Conversation

mustard-mh
Copy link
Contributor

@mustard-mh mustard-mh commented Jul 8, 2022

Description

Related Issue(s)

Fixes #

How to test

  • Open a workspace in prev env
  • Open this gitpod with this PR
  • Get workspace instance id that you created
# from k8s
kubectl get pods | grep ws-

# from workspace terminal
env | grep INSTANCE_ID
  • Exec gpctl workspaces last-heartbeat <instance_id> in gitpod repo workspace

Should output like

gitpod /workspace/gitpod/dev/gpctl (main) $ go run main.go workspaces last-heartbeat 3191e531-2c7c-42e5-8f28-57ab47fd33f9
2022-07-08T09:21:09.103544311Z

Release Notes

NONE

Documentation

Werft options:

  • /werft with-preview

@mustard-mh mustard-mh requested a review from a team July 8, 2022 09:29
@github-actions github-actions bot added the team: workspace Issue belongs to the Workspace team label Jul 8, 2022
}
defer conn.Close()

instanceID := args[0]
Copy link
Contributor

Choose a reason for hiding this comment

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

How about receiving get multiple instances IDs?

Copy link
Contributor

Choose a reason for hiding this comment

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

That probably can be done as a separate PR. But good suggestion.

Copy link
Contributor Author

@mustard-mh mustard-mh Jul 8, 2022

Choose a reason for hiding this comment

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

I'm not going to create a follow-up PR to support multiple instance ids since our commands like snapshot stop backup all only works for one instance.

We can do mutiple-ify it like

cat backup-pods.txt | xargs -n1 -I{} gpctl workspaces backup {}

Or put make commands support multiple instances in our plan?

Copy link
Contributor

@sagor999 sagor999 left a comment

Choose a reason for hiding this comment

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

LGTM
/hold
for minor fix

@mustard-mh
Copy link
Contributor Author

/unhold

@roboquat roboquat merged commit 4576377 into main Jul 8, 2022
@roboquat roboquat deleted the hw/gpctl branch July 8, 2022 17:30
@roboquat roboquat added deployed: workspace Workspace team change is running in production deployed Change is completely running in production labels Jul 12, 2022
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 release-note-none size/M team: workspace Issue belongs to the Workspace team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants