derailed / k9s

🐶 Kubernetes CLI To Manage Your Clusters In Style!
https://k9scli.io
Apache License 2.0
26.48k stars 1.66k forks source link

Port ranges in network policies are not rendered #2635

Open rthrippleton opened 5 months ago

rthrippleton commented 5 months ago




Describe the bug When a network policy contains a TCP port range, that range is shown as an individual port rather than a range in the describe view and the list view.

To Reproduce Create a network policy with a port range e.g.

  - ports:                                                                                                                                                                                                                                                                                                                     
    - endPort: 5200                                                                                                                                                                                                                                                                                                            
      port: 5000                                                                                                                                                                                                                                                                                                               
      protocol: TCP

then locate it in the list view and notice that it only describes it as TCP:5000, and similarly in the describe ('d') view.

Expected behavior Expect to see a description of the port range.

Versions (please complete the following information):

derailed commented 5 months ago

@rthrippleton Not an excuse, but I think on part with kubectl (since we use the same api) What does k describe netpol xxx report?

rthrippleton commented 5 months ago

Oh, you're absolutely right!

From my YAML above, the equivalent kubectl describe is

    ----------
    To Port: 5000/TCP
    From: <any> (traffic not restricted by source)

Is this going to be the same reason behind the list view showing TCP:5000 for the ING-PORTS column?

Out of interest, does k9s used whatever kubectl is on the path, or does it have its own embedded? I think my local install has a fairly old install of kubectl, and maybe this issue got fixed in a later one?