Skip to content

Commit 9ae0efc

Browse files
committed
CR fixes
Signed-off-by: gshaibi <gshaibi@nvidia.com>
1 parent c4a03fa commit 9ae0efc

4 files changed

Lines changed: 8 additions & 17 deletions

File tree

cmd/admission/app/app.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,7 @@ func (app *App) Run() error {
167167
return err
168168
}
169169

170-
// Separate endpoint, not an addition to the pod validator above: the rules
171-
// are disjoint (this one matches only the pods/resize subresource, so no
172-
// request is ever validated twice) and the failure policies differ (resize
173-
// is fail-open Ignore, pod validation is Fail). The canonical
174-
// /validate--v1-pod path is taken, hence the custom path.
170+
// Add a new webhook for the resize subresource with Ignore failPolicy
175171
if err = ctrl.NewWebhookManagedBy(app.manager, &corev1.Pod{}).
176172
WithValidator(admissionhooks.NewPodResizeValidator(
177173
app.manager.GetClient(),

cmd/admission/app/options.go

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,13 @@ func InitOptions() *Options {
103103
constants.DefaultRuntimeClassName))
104104
fs.BoolVar(&options.ValidatePodResizeQuota,
105105
"validate-pod-resize-quota", true,
106-
"Enable hierarchical queue limit and quota checks on pods/resize requests. "+
107-
"Checks are best-effort (fail-open): a resize is admitted rather than blocked when "+
108-
"the webhook or its queue and podgroup lookups are unavailable. "+
109-
"When false, the webhook admits all resizes without checking queue limits or quota, "+
110-
"and --block-upsize-on-bounded-queues is ignored.")
106+
"Enable queue limit/quota checks on pod resize requests. "+
107+
"Best-effort: if lookups fail, resize is admitted. "+
108+
"Ignored if false, disables --block-upsize-on-bounded-queues.")
111109
fs.BoolVar(&options.BlockUpsizeOnBoundedQueues,
112110
"block-upsize-on-bounded-queues", false,
113-
"Reject any upsize on a queue (or ancestor) with a finite CPU or memory limit, "+
114-
"regardless of current allocation. Prevents concurrent-resize races from exceeding hard limits. "+
115-
"Has no effect when --validate-pod-resize-quota is false.")
111+
"Block pod upsize if queue or ancestor has a CPU/memory limit. "+
112+
"No effect if --validate-pod-resize-quota is false.")
116113

117114
utilfeature.DefaultMutableFeatureGate.AddFlag(fs)
118115

pkg/operator/operands/admission/admission_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ var _ = Describe("Admission", func() {
8383
Expect(mutatingWebhook.Webhooks).To(HaveLen(1))
8484
Expect(mutatingWebhook.Webhooks[0].ClientConfig.CABundle).To(Equal(secret.Data[certKey]))
8585

86-
// failurePolicy per webhook: pods=Fail, topology=Fail, pods/resize=Ignore
87-
// (fail-open: the apiserver admits the request if the webhook call fails).
86+
// One webhook for pods, one for the Topology one-to-one alias validation,
87+
// and one for the pods/resize validation.
8888
Expect(validatingWebhook.Webhooks).To(HaveLen(3))
8989
for _, wh := range validatingWebhook.Webhooks {
9090
Expect(wh.ClientConfig.CABundle).To(Equal(secret.Data[certKey]))

pkg/operator/operands/admission/resources.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,6 @@ func (a *Admission) validatingWCForKAIConfig(
319319
},
320320
},
321321
{
322-
// pods/resize is best-effort: failurePolicy=Ignore so webhook unavailability
323-
// never blocks a legitimate in-place pod resize.
324322
Name: fmt.Sprintf("podresize.%s", webhookName),
325323
AdmissionReviewVersions: []string{"v1"},
326324
SideEffects: common.PtrFrom(admissionv1.SideEffectClassNone),

0 commit comments

Comments
 (0)