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

Delete workloads before volumesets on GVC deletion #245

Merged
merged 2 commits into from
Nov 30, 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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ _Please add entries here for your pull requests that have not yet been released.

- Fixed potential infinite loop that could occur for a command if one of the execution steps fails and gets stuck. [PR 217](https://github.com/shakacode/control-plane-flow/pull/217) by [Zakir Dzhamaliddinov](https://github.com/zzaakiirr).

- Fixed issue where app cannot be deleted because one of the workloads has a volumeset in-use. [PR 245](https://github.com/shakacode/control-plane-flow/pull/245) by [Zakir Dzhamaliddinov](https://github.com/zzaakiirr).

## [4.0.0] - 2024-08-21

### Fixed
Expand Down
6 changes: 3 additions & 3 deletions lib/command/delete.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ def delete_workload(workload)
def delete_volumesets
@volumesets.each do |volumeset|
step("Deleting volumeset '#{volumeset['name']}' from app '#{config.app}'") do
# If the volumeset is attached to a workload, we need to delete the workload first
workload = volumeset.dig("status", "usedByWorkload")&.split("/")&.last
cp.delete_workload(workload) if workload
# If the volumeset is attached to workloads, we need to delete the workloads first
workloads = volumeset.dig("status", "workloadLinks")&.map { |workload_link| workload_link.split("/").last }
workloads&.each { |workload| cp.delete_workload(workload) }

cp.delete_volumeset(volumeset["name"])
end
Expand Down