mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
Merge pull request #64654 from atlassian/missing-error-handling
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Add missing error handling in schema-related code **What this PR does / why we need it**: Adds missing error handling to a few places. **Which issue(s) this PR fixes** Updates #51457. Still more work to do to fix the issue - client generation code needs to be updated (addressed in https://github.com/kubernetes/kubernetes/pull/64664). **Release note**: ```release-note NONE ``` /kind bug /sig api-machinery
This commit is contained in:
@@ -38,6 +38,7 @@ import (
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/runtime/serializer/json"
|
||||
"k8s.io/apimachinery/pkg/runtime/serializer/streaming"
|
||||
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
restclient "k8s.io/client-go/rest"
|
||||
"k8s.io/client-go/rest/fake"
|
||||
@@ -61,9 +62,9 @@ var openapiSchemaPath = filepath.Join("..", "..", "..", "..", "api", "openapi-sp
|
||||
|
||||
// This init should be removed after switching this command and its tests to user external types.
|
||||
func init() {
|
||||
api.AddToScheme(scheme.Scheme)
|
||||
scheme.Scheme.AddConversionFuncs(v1.Convert_core_PodSpec_To_v1_PodSpec)
|
||||
scheme.Scheme.AddConversionFuncs(v1.Convert_v1_PodSecurityContext_To_core_PodSecurityContext)
|
||||
utilruntime.Must(api.AddToScheme(scheme.Scheme))
|
||||
utilruntime.Must(scheme.Scheme.AddConversionFuncs(v1.Convert_core_PodSpec_To_v1_PodSpec))
|
||||
utilruntime.Must(scheme.Scheme.AddConversionFuncs(v1.Convert_v1_PodSecurityContext_To_core_PodSecurityContext))
|
||||
}
|
||||
|
||||
var unstructuredSerializer = resource.UnstructuredPlusDefaultContentConfig().NegotiatedSerializer
|
||||
|
||||
Reference in New Issue
Block a user