File tree 1 file changed +5
-6
lines changed
staging/src/k8s.io/apiserver/pkg/admission/plugin/policy/mutating
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(
162
162
}
163
163
164
164
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
+ }
165
170
if reinvokeCtx .IsReinvoke () && ! policyReinvokeCtx .ShouldReinvoke (invocationKey ) {
166
171
continue
167
172
}
@@ -170,12 +175,6 @@ func (d *dispatcher) dispatchInvocations(
170
175
// Mutations for a single invocation of a MutatingAdmissionPolicy are evaluated
171
176
// in order.
172
177
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
-
179
178
lastVersionedAttr = versionedAttr
180
179
if versionedAttr .VersionedObject == nil { // Do not call patchers if there is no object to patch.
181
180
continue
You can’t perform that action at this time.
0 commit comments