Merge pull request #122346 from Jefftree/patcher-fix-openapigetter-nil

Make Patcher tolerant of OpenAPIGetter being nil
This commit is contained in:
Kubernetes Prow Robot 2023-12-27 22:01:30 +01:00 committed by GitHub
commit 1b6b3ba013
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -156,7 +156,7 @@ func (p *Patcher) patchSimple(obj runtime.Object, modified []byte, namespace, na
}
}
if patch == nil {
if patch == nil && p.OpenAPIGetter != nil {
if openAPISchema, err := p.OpenAPIGetter.OpenAPISchema(); err == nil && openAPISchema != nil {
// if openapischema is used, we'll try to get required patch type for this GVK from Open API.
// if it fails or could not find any patch type, fall back to baked-in patch type determination.