Skip to content

Commit 96e64a9

Browse files
Merge pull request #1965 from damdo/apply-directly-add-admissionregistrationv1-support
OCPBUGS-56709: fix: ApplyDirectly add missing support for admissionregistrationv1 ValidatingAdmissionPolicy, ValidatingAdmissionPolicyBinding
2 parents 7de7fae + 517854e commit 96e64a9

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pkg/operator/resource/resourceapply/generic.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,18 @@ func ApplyDirectly(ctx context.Context, clients *ClientHolder, recorder events.R
215215
} else {
216216
result.Result, result.Changed, result.Error = ApplyValidatingAdmissionPolicyBindingV1beta1(ctx, clients.kubeClient.AdmissionregistrationV1beta1(), recorder, t, cache)
217217
}
218+
case *admissionregistrationv1.ValidatingAdmissionPolicy:
219+
if clients.kubeClient == nil {
220+
result.Error = fmt.Errorf("missing kubeClient")
221+
} else {
222+
result.Result, result.Changed, result.Error = ApplyValidatingAdmissionPolicyV1(ctx, clients.kubeClient.AdmissionregistrationV1(), recorder, t, cache)
223+
}
224+
case *admissionregistrationv1.ValidatingAdmissionPolicyBinding:
225+
if clients.kubeClient == nil {
226+
result.Error = fmt.Errorf("missing kubeClient")
227+
} else {
228+
result.Result, result.Changed, result.Error = ApplyValidatingAdmissionPolicyBindingV1(ctx, clients.kubeClient.AdmissionregistrationV1(), recorder, t, cache)
229+
}
218230
case *storagev1.CSIDriver:
219231
if clients.kubeClient == nil {
220232
result.Error = fmt.Errorf("missing kubeClient")

0 commit comments

Comments
 (0)