MCPcopy
hub / github.com/argoproj/argo-workflows / RecursiveRemoveDescriptions

Method RecursiveRemoveDescriptions

hack/manifests/helpers.go:18–41  ·  view source on GitHub ↗
(fields ...string)

Source from the content-addressed store, hash-verified

16}
17
18func (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
44func (o *obj) RecursiveRemoveValidations(fields ...string) {

Callers 3

cleanCRDFunction · 0.80
patchWorkflowSpecFunction · 0.80

Calls 2

nestedFieldNoCopyFunction · 0.85
deleteFunction · 0.50

Tested by 1