Skip to content

Commit 29e197b

Browse files
committed
[fix] dont delete hook
Signed-off-by: Stepan Paksashvili <[email protected]>
1 parent 78edf19 commit 29e197b

File tree

1 file changed

+3
-9
lines changed
  • common-hooks/storage-class-change

1 file changed

+3
-9
lines changed

common-hooks/storage-class-change/hook.go

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ func storageClassChange(ctx context.Context, input *pkg.HookInput, args Args) er
194194
},
195195
}
196196

197-
input.Logger.Info("evict pod due",
197+
input.Logger.Info("evict pod",
198198
slog.String("namespace", pod.Namespace),
199199
slog.String("pod", pod.Name),
200200
slog.String("pvc", pvc.Name))
@@ -232,7 +232,7 @@ func storageClassChange(ctx context.Context, input *pkg.HookInput, args Args) er
232232
}
233233
}
234234

235-
input.Logger.Info("storageClass changed. Deleting objects",
235+
input.Logger.Info("storageClass changed, delete objects",
236236
slog.String("namespace", args.Namespace),
237237
slog.String("object_kind", args.ObjectKind),
238238
slog.String("name", args.ObjectName))
@@ -251,13 +251,7 @@ func storageClassChange(ctx context.Context, input *pkg.HookInput, args Args) er
251251
}
252252
err = kubeClient.Delete(ctx, obj)
253253
case "Deployment":
254-
obj := &appsv1.Deployment{
255-
ObjectMeta: metav1.ObjectMeta{
256-
Name: args.ObjectName,
257-
Namespace: args.Namespace,
258-
},
259-
}
260-
err = kubeClient.Delete(ctx, obj)
254+
return nil
261255
default:
262256
return fmt.Errorf("unknown object kind %s", args.ObjectKind)
263257
}

0 commit comments

Comments
 (0)