You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge pull request #55936 from shiywang/json_test_enhance
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>.
Some test enhance, comments enhance and duplicate code reduce
while I was learning the codebase, found some place could be enhance, not confident about the comments of `Decode` I changed isn't right.
/assign @sttts PTAL, thanks
```release-note
NONE
```
Kubernetes-commit: fce605fad1ae9d7bd1464af012ddd0940bdb8616
// Decode attempts to convert the provided data into YAML or JSON, extract the stored schema kind, apply the provided default gvk, and then
102
-
// load that data into an object matching the desired schema kind or the provided into. If into is *runtime.Unknown, the raw data will be
103
-
// extracted and no decoding will be performed. If into is not registered with the typer, then the object will be straight decoded using
104
-
// normal JSON/YAML unmarshalling. If into is provided and the original data is not fully qualified with kind/version/group, the type of
105
-
// the into will be used to alter the returned gvk. On success or most errors, the method will return the calculated schema kind.
117
+
// load that data into an object matching the desired schema kind or the provided into.
118
+
// If into is *runtime.Unknown, the raw data will be extracted and no decoding will be performed.
119
+
// If into is not registered with the typer, then the object will be straight decoded using normal JSON/YAML unmarshalling.
120
+
// If into is provided and the original data is not fully qualified with kind/version/group, the type of the into will be used to alter the returned gvk.
121
+
// If into is nil or data's gvk different from into's gvk, it will generate a new Object with ObjectCreater.New(gvk)
122
+
// On success or most errors, the method will return the calculated schema kind.
123
+
// The gvk calculate priority will be originalData > default gvk > into
0 commit comments