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 @@ -161,6 +161,11 @@ func (d *dispatcher) dispatchInvocations(
161
161
}
162
162
163
163
invocationKey , invocationKeyErr := keyFor (invocation )
164
+ if invocationKeyErr != nil {
165
+ // This should never happen. It occurs if there is a programming
166
+ // error causing the Param not to be a valid object.
167
+ return nil , k8serrors .NewInternalError (invocationKeyErr )
168
+ }
164
169
if reinvokeCtx .IsReinvoke () && ! policyReinvokeCtx .ShouldReinvoke (invocationKey ) {
165
170
continue
166
171
}
@@ -169,12 +174,6 @@ func (d *dispatcher) dispatchInvocations(
169
174
// Mutations for a single invocation of a MutatingAdmissionPolicy are evaluated
170
175
// in order.
171
176
for mutationIndex := range invocation .Policy .Spec .Mutations {
172
- if invocationKeyErr != nil {
173
- // This should never happen. It occurs if there is a programming
174
- // error causing the Param not to be a valid object.
175
- return nil , k8serrors .NewInternalError (invocationKeyErr )
176
- }
177
-
178
177
lastVersionedAttr = versionedAttr
179
178
if versionedAttr .VersionedObject == nil { // Do not call patchers if there is no object to patch.
180
179
continue
You can’t perform that action at this time.
0 commit comments