Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't view some NetworkPolicys, throws TypeError #4677

Closed
MarcMielke opened this issue Jan 12, 2022 · 1 comment
Closed

Can't view some NetworkPolicys, throws TypeError #4677

MarcMielke opened this issue Jan 12, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@MarcMielke
Copy link

MarcMielke commented Jan 12, 2022

Can't view some NetworkPolicys, throws TypeError

Version
Lens: 5.3.3-latest.20211223.1
Electron: 13.6.1
Chrome: 91.0.4472.164
Node: 14.16.0

OS
macOS Big Sur 11.4

Component stack:
at NetworkPolicyDetails (http://aa1db0fcc5eb08e750c8d3e60aa45241.localhost:52148/build/Lens.js:476092:51)
at div
at div
at div
at Animate (http://aa1db0fcc5eb08e750c8d3e60aa45241.localhost:52148/build/Lens.js:148838:9)
at drawer_Drawer (http://aa1db0fcc5eb08e750c8d3e60aa45241.localhost:52148/build/Lens.js:14247:9)
at KubeObjectDetails (http://aa1db0fcc5eb08e750c8d3e60aa45241.localhost:52148/build/Lens.js:289281:9)
at ErrorBoundary (http://aa1db0fcc5eb08e750c8d3e60aa45241.localhost:52148/build/Lens.js:237976:9)
at Router (http://aa1db0fcc5eb08e750c8d3e60aa45241.localhost:52148/build/Lens.js:79057:30)
at ClusterFrame (http://aa1db0fcc5eb08e750c8d3e60aa45241.localhost:52148/build/chunks/5.js:7941:9)
at ThemeProvider (http://aa1db0fcc5eb08e750c8d3e60aa45241.localhost:52148/build/Lens.js:609886:24)

Error stack:
TypeError: Cannot convert undefined or null to object
at Function.entries ()
at NetworkPolicyDetails.renderIPolicySelector (http://aa1db0fcc5eb08e750c8d3e60aa45241.localhost:52148/build/Lens.js:476112:14)
at http://aa1db0fcc5eb08e750c8d3e60aa45241.localhost:52148/build/Lens.js:476125:22
at Array.map ()
at NetworkPolicyDetails.renderNetworkPolicyPeers (http://aa1db0fcc5eb08e750c8d3e60aa45241.localhost:52148/build/Lens.js:476123:19)
at http://aa1db0fcc5eb08e750c8d3e60aa45241.localhost:52148/build/Lens.js:476159:26
at Array.map ()
at NetworkPolicyDetails.render (http://aa1db0fcc5eb08e750c8d3e60aa45241.localhost:52148/build/Lens.js:476157:25)
at allowStateChanges (http://aa1db0fcc5eb08e750c8d3e60aa45241.localhost:52148/build/Lens.js:2571:12)
at http://aa1db0fcc5eb08e750c8d3e60aa45241.localhost:52148/build/Lens.js:11008:59
at trackDerivedFunction (http://aa1db0fcc5eb08e750c8d3e60aa45241.localhost:52148/build/Lens.js:3120:18)
at Reaction.track (http://aa1db0fcc5eb08e750c8d3e60aa45241.localhost:52148/build/Lens.js:3649:18)
at NetworkPolicyDetails.reactiveRender [as render] (http://aa1db0fcc5eb08e750c8d3e60aa45241.localhost:52148/build/Lens.js:11006:14)
at qi (http://aa1db0fcc5eb08e750c8d3e60aa45241.localhost:52148/build/Lens.js:556402:188)
at pi (http://aa1db0fcc5eb08e750c8d3e60aa45241.localhost:52148/build/Lens.js:556401:173)
at ck (http://aa1db0fcc5eb08e750c8d3e60aa45241.localhost:52148/build/Lens.js:556484:427)

To Reproduce
I believe this can be reproduced by having a spec.ingress.[...].from[...].namespaceSelector: {} declaration, so far that's the only difference compared to other (viewable/editable) policies I could spot at a first quick glance.

Example:

spec:
  ingress:
  - from:
    - podSelector:
        matchLabels:
          k8s-app: grafana
    - podSelector:
        matchLabels:
          k8s-app: prometheus
    - podSelector:
        matchLabels:
          k8s-app: ingress
          role: controller
    - namespaceSelector: {}
    ports:
    - port: 9090
      protocol: TCP
  podSelector:
    matchLabels:
      k8s-app: prometheus
  policyTypes:
  - Ingress
@MarcMielke MarcMielke added the bug Something isn't working label Jan 12, 2022
@Nokel81
Copy link
Collaborator

Nokel81 commented Jan 17, 2022

Duplicate of #4497, already fixed by #4500.

@Nokel81 Nokel81 closed this as completed Jan 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants