Skip to content

[FEATURE_REQUEST] validate that probe port match a existing portΒ #455

Open
@jouve

Description

@jouve

Description of the problem/feature request

when defining probes (liveness, readiness, startup) , the port can be specified as either an int or a string.
In that case, the string must match the name of a port defined in ports.

I suggest a check to validate that when the probe port is a string, it matches one the port by name.

Additional context

in case of mismatch, the yaml is accepted by the kubernetes, but the probe will fail latter : Liveness probe errored: strconv.Atoi: parsing "xxx": invalid syntax

would be ok:

containers:
- ports:
  - containerPort: 1234
    name: probe
  livenessProbe:
    httpGet:
      port: probe

would be an error:

containers:
- ports:
  - containerPort: 1234
    name: probe
  livenessProbe:
    httpGet:
      port: foo

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions