| 16 | } |
| 17 | |
| 18 | func (o *obj) RecursiveRemoveDescriptions(fields ...string) { |
| 19 | if _, found, _ := unstructured.NestedFieldNoCopy(*o, fields...); !found { |
| 20 | return |
| 21 | } |
| 22 | startField := nestedFieldNoCopy[map[string]any](o, fields...) |
| 23 | if description, found := startField["description"]; found { |
| 24 | startField["description"] = description.(string) + ".\nAll nested field descriptions have been dropped due to Kubernetes size limitations." |
| 25 | } |
| 26 | |
| 27 | var rec func(field *map[string]any) |
| 28 | rec = func(field *map[string]any) { |
| 29 | if _, ok := (*field)["description"].(string); ok { |
| 30 | delete(*field, "description") |
| 31 | } |
| 32 | for _, value := range *field { |
| 33 | if nested, ok := value.(map[string]any); ok { |
| 34 | rec(&nested) |
| 35 | } |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | properties := startField["properties"].(map[string]any) |
| 40 | rec(&properties) |
| 41 | } |
| 42 | |
| 43 | // Status block validation is expensive and less needed |
| 44 | func (o *obj) RecursiveRemoveValidations(fields ...string) { |