appendResult attempts to find a result in results that matches r.Name, and if found appends errors and warnings to that result. Otherwise r is added to the end of results.
(results []apierrors.ManifestResult, r apierrors.ManifestResult)
| 115 | // if found appends errors and warnings to that result. Otherwise r is added |
| 116 | // to the end of results. |
| 117 | func appendResult(results []apierrors.ManifestResult, r apierrors.ManifestResult) []apierrors.ManifestResult { |
| 118 | resultIdx := -1 |
| 119 | for i, result := range results { |
| 120 | if result.Name == r.Name { |
| 121 | resultIdx = i |
| 122 | break |
| 123 | } |
| 124 | } |
| 125 | if resultIdx < 0 { |
| 126 | results = append(results, r) |
| 127 | } else { |
| 128 | results[resultIdx].Add(r.Errors...) |
| 129 | results[resultIdx].Add(r.Warnings...) |
| 130 | } |
| 131 | |
| 132 | return results |
| 133 | } |
| 134 | |
| 135 | // RewriteAnnotationsYaml unmarshalls the specified yaml file, appends the content and |
| 136 | // converts it again to yaml. |
no outgoing calls
no test coverage detected