kubewarden / helm-charts

Helm charts for the Kubewarden project
Apache License 2.0
25 stars 17 forks source link

Wrong questions for Host Namespaces PSP #439

Closed kravciak closed 5 months ago

kravciak commented 5 months ago

Setting port value to 80 for example produces following error on policy server: Error(\"invalid type: string \\\"80\\\", expected a sequence\", line: 1, column: 97)")

Current state

Questions on kubewarden-defaults helm chart provide single input field for allow_host_ports, which generates following YAML:

Screenshot from 2024-04-22 16-07-19

Yaml generated by creating policy from kubewarden-defaults helm chart:

    settings:
      allow_host_ipc: false
      allow_host_network: false
      allow_host_pid: false
      allow_host_ports: 80,443

Expected state

Policy settings expect ports to be a range, giving min & max value.

Screenshot from 2024-04-22 16-10-20

Yaml generated by creating policy from ClusterAdmissionPolicies page:

  settings:
    allow_host_ipc: true
    allow_host_network: false
    allow_host_pid: false
    allow_host_ports:
      - min: 80
        max: 80
      - min: 8000
        max: 9000