Skip to content

Commit a1ca483

Browse files
committed
Delete workload cluster as expected by Cluster API
Fixes #2353 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
1 parent 097069e commit a1ca483

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/tasks/setup/cluster_api_setup.cr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ namespace "setup" do
7575

7676
desc "Uninstall Cluster API"
7777
task "cluster_api_uninstall" do |_, args|
78-
current_dir = FileUtils.pwd
79-
delete_cluster_file = "#{current_dir}/capi.yaml"
80-
# TODO: Ensure all dependent resources are deleted before deleting capi.yaml
81-
begin KubectlClient::Delete.file("#{delete_cluster_file}") rescue KubectlClient::ShellCMD::NotFoundError end
78+
cmd = "kubectl delete cluster capi-quickstart --wait"
79+
Process.run(cmd, shell: true, output: stdout = IO::Memory.new, error: stderr = IO::Memory.new)
80+
Log.debug { "#{cmd}: #{stdout.to_s}" }
8281

8382
cmd = "clusterctl delete --all --include-crd --include-namespace"
8483
Process.run(cmd, shell: true, output: stdout = IO::Memory.new, error: stderr = IO::Memory.new)
84+
Log.debug { "#{cmd}: #{stdout.to_s}" }
8585
end
8686
end

0 commit comments

Comments
 (0)