-
Bug
-
Resolution: Done
-
Undefined
-
4.20, 4.21, 4.21.0
-
None
-
Quality / Stability / Reliability
-
False
-
-
None
-
Moderate
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Description of problem:
On add/edit HPA yaml view page, set invalid object for spec.metrics field, eg: 'metrics: {}', then switch to form view, it will throw runtime error:
Something wrong happened
s.findIndex is not a function
Version-Release number of selected component (if applicable):
4.20.0-0.nightly-2025-10-22-194414
4.21.0-0.nightly-2025-10-22-123727
How reproducible:
Always
Steps to Reproduce:
1.Go to a deployment page, open add/edit HPA page from action list.
2.On yaml view page, set invalid object for spec.metrics field, eg: 'metrics: {}'. Click 'Save'
3.Switch to form view page.
Actual results:
2. There will be an error info to point out the invalid field:
An error occurred
HorizontalPodAutoscaler in version "v2" cannot be handled as a HorizontalPodAutoscaler: json: cannot unmarshal object into Go struct field HorizontalPodAutoscalerSpec.spec.metrics of type []v2.MetricSpec
3. The page meets runtime error:
Something wrong happened
s.findIndex is not a function
Expected results:
3. Should not meet runtime error. It's acceptable to show similar error info as yaml view or ignore the invalid set.
Additional info: