Skip to content

Commit 946d65b

Browse files
committed
ROSAENG-61173 | fix: wrap handleClusterDelete error with cluster context
Signed-off-by: lufreita <lufreita@redhat.com>
1 parent 0f94be2 commit 946d65b

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

cmd/dlt/cluster/cmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ func runWithRuntime(r *rosa.Runtime, _ *cobra.Command, _ []string) error {
109109

110110
err := handleClusterDelete(r, cluster, clusterKey, args.bestEffort)
111111
if err != nil {
112-
return err
112+
return fmt.Errorf("failed to delete cluster '%s': %w", clusterKey, err)
113113
}
114114

115115
if cluster.AWS().STS().RoleARN() != "" {

cmd/dlt/cluster/cmd_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ var _ = Describe("Delete cluster", func() {
243243
Expect(err).To(HaveOccurred())
244244
Expect(stderr).To(BeEmpty())
245245
Expect(stdout).To(BeEmpty())
246+
Expect(err.Error()).To(ContainSubstring("failed to delete cluster"))
246247
Expect(err.Error()).To(ContainSubstring("expected response content type"))
247248
})
248249

@@ -273,6 +274,7 @@ var _ = Describe("Delete cluster", func() {
273274
Expect(err).To(HaveOccurred())
274275
Expect(stderr).To(BeEmpty())
275276
Expect(stdout).To(BeEmpty())
277+
Expect(err.Error()).To(ContainSubstring("failed to delete cluster"))
276278
Expect(err.Error()).To(ContainSubstring("forbidden"))
277279
})
278280
})

0 commit comments

Comments
 (0)