mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #46418 from zjj2wry/ux
Automatic merge from submit-queue fix err message typo and small change in UX **What this PR does / why we need it**: 1. small ux change 2. fix typo: convertable to convertible **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # **Special notes for your reviewer**: **Release note**: ```release-note NONE ```
This commit is contained in:
commit
7f8fd32ecb
@ -28,8 +28,7 @@ import (
|
||||
// object. (Will modify internalObject.) (Assumes JSON serialization.)
|
||||
// TODO: verify that the correct external version is chosen on encode...
|
||||
func CheckCodec(c Codec, internalType Object, externalTypes ...schema.GroupVersionKind) error {
|
||||
_, err := Encode(c, internalType)
|
||||
if err != nil {
|
||||
if _, err := Encode(c, internalType); err != nil {
|
||||
return fmt.Errorf("Internal type not encodable: %v", err)
|
||||
}
|
||||
for _, et := range externalTypes {
|
||||
@ -41,9 +40,8 @@ func CheckCodec(c Codec, internalType Object, externalTypes ...schema.GroupVersi
|
||||
if reflect.TypeOf(obj) != reflect.TypeOf(internalType) {
|
||||
return fmt.Errorf("decode of external type %s produced: %#v", et, obj)
|
||||
}
|
||||
err = DecodeInto(c, exBytes, internalType)
|
||||
if err != nil {
|
||||
return fmt.Errorf("external type %s not convertable to internal type: %v", et, err)
|
||||
if err = DecodeInto(c, exBytes, internalType); err != nil {
|
||||
return fmt.Errorf("external type %s not convertible to internal type: %v", et, err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
Loading…
Reference in New Issue
Block a user