File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
staging/src/k8s.io/apiserver/pkg/admission/plugin/policy/mutating Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -162,6 +162,11 @@ func (d *dispatcher) dispatchInvocations(
162162 }
163163
164164 invocationKey , invocationKeyErr := keyFor (invocation )
165+ if invocationKeyErr != nil {
166+ // This should never happen. It occurs if there is a programming
167+ // error causing the Param not to be a valid object.
168+ return nil , k8serrors .NewInternalError (invocationKeyErr )
169+ }
165170 if reinvokeCtx .IsReinvoke () && ! policyReinvokeCtx .ShouldReinvoke (invocationKey ) {
166171 continue
167172 }
@@ -170,12 +175,6 @@ func (d *dispatcher) dispatchInvocations(
170175 // Mutations for a single invocation of a MutatingAdmissionPolicy are evaluated
171176 // in order.
172177 for mutationIndex := range invocation .Policy .Spec .Mutations {
173- if invocationKeyErr != nil {
174- // This should never happen. It occurs if there is a programming
175- // error causing the Param not to be a valid object.
176- return nil , k8serrors .NewInternalError (invocationKeyErr )
177- }
178-
179178 lastVersionedAttr = versionedAttr
180179 if versionedAttr .VersionedObject == nil { // Do not call patchers if there is no object to patch.
181180 continue
You can’t perform that action at this time.
0 commit comments