mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-02 03:08:15 +00:00
Send pod spec warnings when creating or changing workload objects
This commit is contained in:
@@ -108,7 +108,9 @@ func (podStrategy) Validate(ctx context.Context, obj runtime.Object) field.Error
|
||||
}
|
||||
|
||||
// WarningsOnCreate returns warnings for the creation of the given object.
|
||||
func (podStrategy) WarningsOnCreate(ctx context.Context, obj runtime.Object) []string { return nil }
|
||||
func (podStrategy) WarningsOnCreate(ctx context.Context, obj runtime.Object) []string {
|
||||
return podutil.GetWarningsForPod(ctx, obj.(*api.Pod), nil)
|
||||
}
|
||||
|
||||
// Canonicalize normalizes the object after validation.
|
||||
func (podStrategy) Canonicalize(obj runtime.Object) {
|
||||
@@ -130,6 +132,8 @@ func (podStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object)
|
||||
|
||||
// WarningsOnUpdate returns warnings for the given update.
|
||||
func (podStrategy) WarningsOnUpdate(ctx context.Context, obj, old runtime.Object) []string {
|
||||
// skip warnings on pod update, since humans don't typically interact directly with pods,
|
||||
// and we don't want to pay the evaluation cost on what might be a high-frequency update path
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user