• Kubernetes Submit Queue's avatar
    Merge pull request #50205 from dixudx/fix_kubectl_edit_panic_nil_list · 577fdf91
    Kubernetes Submit Queue authored
    Automatic merge from submit-queue (batch tested with PRs 50537, 49699, 50160, 49025, 50205)
    
    not allowing "kubectl edit <resource>" when you got an empty list
    
    **What this PR does / why we need it**:
    `kubectl edit` will panic when adding an empty list.
    
    > panic: runtime error: index out of range
    
    **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #50147
    
    **Special notes for your reviewer**:
    /assign @errordeveloper @mengqiy @janetkuo @fabianofranz
    /cc @rootfs @soltysh @sttts
    
    **Release note**:
    
    ```release-note
    not allowing "kubectl edit <resource>" when you got an empty list
    ```
    577fdf91
Name
Last commit
Last update
..
editor Loading commit data...
jsonmerge Loading commit data...
openapi Loading commit data...
sanity Loading commit data...
BUILD Loading commit data...
cached_discovery.go Loading commit data...
cached_discovery_test.go Loading commit data...
clientcache.go Loading commit data...
factory.go Loading commit data...
factory_builder.go Loading commit data...
factory_client_access.go Loading commit data...
factory_object_mapping.go Loading commit data...
factory_object_mapping_test.go Loading commit data...
factory_test.go Loading commit data...
helpers.go Loading commit data...
helpers_test.go Loading commit data...
printing.go Loading commit data...
shortcut_restmapper.go Loading commit data...
shortcut_restmapper_test.go Loading commit data...