mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
ExtractList should handle v1.RawExtension correctly
Also fixes CustomColumnPrinter to pass decoder in, and ensures a test case tests the combined path.
This commit is contained in:
@@ -72,12 +72,17 @@ func ExtractList(obj runtime.Object) ([]runtime.Object, error) {
|
||||
for i := range list {
|
||||
raw := items.Index(i)
|
||||
switch item := raw.Interface().(type) {
|
||||
case runtime.RawExtension:
|
||||
switch {
|
||||
case item.Object != nil:
|
||||
list[i] = item.Object
|
||||
case item.RawJSON != nil:
|
||||
list[i] = &runtime.Unknown{RawJSON: item.RawJSON}
|
||||
default:
|
||||
list[i] = nil
|
||||
}
|
||||
case runtime.Object:
|
||||
list[i] = item
|
||||
case runtime.RawExtension:
|
||||
list[i] = &runtime.Unknown{
|
||||
RawJSON: item.RawJSON,
|
||||
}
|
||||
default:
|
||||
var found bool
|
||||
if list[i], found = raw.Addr().Interface().(runtime.Object); !found {
|
||||
|
||||
Reference in New Issue
Block a user