Skip to content

Commit

Permalink
Make OpenAPIGetter tolerant of nil
Browse files Browse the repository at this point in the history
Kubernetes-commit: 0da29848c538813bba8f9aa2e23542456105caa8
  • Loading branch information
Jefftree authored and k8s-publishing-bot committed Dec 15, 2023
1 parent 854aec7 commit 778ed2b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/cmd/apply/patcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 778ed2b

Please sign in to comment.