rancher / dashboard

The Rancher UI
https://rancher.com
Apache License 2.0
450 stars 256 forks source link

Removing Runas User ID causes validation error on save #9601

Open dbrosy opened 1 year ago

dbrosy commented 1 year ago

Setup

Describe the bug removing Security Context "Runas User ID" causes error in UI

To Reproduce

  1. open cluster
  2. select workloads
  3. Select Create
  4. choose Deployment
  5. on container-0 provide image (e.g nginx:latest)
  6. select Security Context
  7. Enter 33 in "Run as User ID"
  8. Save
  9. Edit Config for workload just created
  10. Under Security Context remove 33 from "Run as User ID"
  11. Try to save

Result

Deployment in version "v1" cannot be handled as a Deployment: json: cannot unmarshal string into Go struct field SecurityContext.spec.template.spec.containers.securityContext.runAsUser of type int64

Expected Result Config change should be saved

Note: When removing the number single quotes are left behind causing the failure. If I edit yaml and remove ID then it saves correctly

Tested on 2.7.5 and 2.7.7-rc4 - both have issue

dbrosy commented 11 months ago

Tested on final 2.7.7 and issue is still there.

Problem is when deleting value the empty value is being set to an empty string