-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
fix: purge #1456
base: target-workspace-refactor
Are you sure you want to change the base?
fix: purge #1456
Conversation
891d024
to
acb55fd
Compare
6780931
to
b67a139
Compare
b6bdf4c
to
84a5d97
Compare
This Pull Request has been automatically marked as "stale" because it has not had recent activity (for 14 days). It will be closed if no further activity occurs. Thank you for your contribution. |
93c9a44
to
affdf9c
Compare
affdf9c
to
331e79c
Compare
Signed-off-by: Luka Brecic <[email protected]>
331e79c
to
9592400
Compare
pkg/cmd/runner/purge.go
Outdated
return err | ||
} | ||
|
||
var serverStoppedCheck bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be called runnerStoppedCheck
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, you need to run the health check before the prompt. There's no need for the prompt if the runner is not running.
pkg/views/purge/purge_resources.go
Outdated
) | ||
|
||
func PurgeResourcesPrompt(continuePurge *bool, numOfTargets, numOfWorkspaces, numOfBuilds int) { | ||
titleMsg := fmt.Sprintf("Leftover resources found: [targets: %d, workspaces: %d, builds: %d]\nWould you like to continue with purge?", numOfTargets, numOfWorkspaces, numOfBuilds) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make this a bit more user friendly.
- Only display resources that are len > 0
- Display the suggested commands to run to remove those resources
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Screen.Recording.2025-01-10.at.14.06.08.mov
Signed-off-by: Luka Brecic <[email protected]>
Signed-off-by: Luka Brecic <[email protected]>
} | ||
} | ||
if !continuePurge { | ||
fmt.Printf("\nOperation cancelled.\nManually delete leftover resources for a complete purge by running following commands:\n%s\n", strings.Join(commands, "\n")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add one more new line after by running following commands:
.
Also, I suggest that we remove Delete {targets|workspaces|builds:
and just print out the commands. That's easier to copy paste.
Purge revision
Description
This PR revisions purge functionality in regards to changes introduced with refactor.
Targets, workspaces and builds are now not automatically purged, but user is rather prompted whether or not they wish to continue the purge with existing resources or if they would rather remove them manually before the complete purge thus making purge removing only CLI dependent files such as configuration files, ssh files, etc.
All
AwaitEmptyList
methods are completely removed.Server.Purge method is removed since it became obsolete once automated resource purge is removed.
Runner purging providers is implemented via
daytona runner purge
command implementation.Local runner providers purge is implemented within the
daytona purge
command.A health-check endpoint is added to Daytona runner in order to execute
daytona runner purge
correctly.This change requires a documentation update
I have made corresponding changes to the documentation