Skip to content

NPM Panics when port is empty and enters in a CrashLoop #609

@jloaiza

Description

@jloaiza

What happened:
I notice policies were not being applied and when I checked the npm pod was in a crash loop.

The message goes as follow:
Observed a panic: "invalid memory address or nil pointer dereference"

What you expected to happen:

The npm pod is up and running and the policies being applied. If I have a wrong policy it should be rejected when applied, if the NPM doesn't support it, at least it should gracefully die and log why (it took me a while to figure out what was causing the error).

How to reproduce it:

Create a policy with an empty port element:

  ports:
  - {}

Kubernetes Version:

Server Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.9", GitCommit:"a2cfecc33f6911261fb8a670d2df2714094002a6", GitTreeState:"clean", BuildDate:"2020-05-29T21:50:25Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}

NPM image version: v1.1.4

Miscellaneous information:
The cluster was created using the Azure portal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions