@@ -194,7 +194,7 @@ func storageClassChange(ctx context.Context, input *pkg.HookInput, args Args) er
194
194
},
195
195
}
196
196
197
- input .Logger .Info ("evict pod due " ,
197
+ input .Logger .Info ("evict pod" ,
198
198
slog .String ("namespace" , pod .Namespace ),
199
199
slog .String ("pod" , pod .Name ),
200
200
slog .String ("pvc" , pvc .Name ))
@@ -232,7 +232,7 @@ func storageClassChange(ctx context.Context, input *pkg.HookInput, args Args) er
232
232
}
233
233
}
234
234
235
- input .Logger .Info ("storageClass changed. Deleting objects" ,
235
+ input .Logger .Info ("storageClass changed, delete objects" ,
236
236
slog .String ("namespace" , args .Namespace ),
237
237
slog .String ("object_kind" , args .ObjectKind ),
238
238
slog .String ("name" , args .ObjectName ))
@@ -251,13 +251,7 @@ func storageClassChange(ctx context.Context, input *pkg.HookInput, args Args) er
251
251
}
252
252
err = kubeClient .Delete (ctx , obj )
253
253
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
261
255
default :
262
256
return fmt .Errorf ("unknown object kind %s" , args .ObjectKind )
263
257
}
@@ -315,23 +309,12 @@ func calculateEffectiveStorageClass(input *pkg.HookInput, args Args, currentStor
315
309
internalValuesPath = fmt .Sprintf ("%s.internal.%s.effectiveStorageClass" , strcase .ToLowerCamel (args .ModuleName ), args .InternalValuesSubPath )
316
310
}
317
311
318
- emptydirUsageMetricValue := 0.0
319
312
if len (effectiveStorageClass ) == 0 || effectiveStorageClass == "false" {
320
313
input .Values .Set (internalValuesPath , false )
321
- emptydirUsageMetricValue = 1.0
322
314
} else {
323
315
input .Values .Set (internalValuesPath , effectiveStorageClass )
324
316
}
325
317
326
- input .MetricsCollector .Set (
327
- "d8_emptydir_usage" ,
328
- emptydirUsageMetricValue ,
329
- map [string ]string {
330
- "namespace" : args .Namespace ,
331
- "module_name" : args .ModuleName ,
332
- },
333
- )
334
-
335
318
return effectiveStorageClass , nil
336
319
}
337
320
0 commit comments