MCPcopy
hub / github.com/helm/helm / newReleaseListWriter

Function newReleaseListWriter

pkg/cmd/list.go:158–184  ·  view source on GitHub ↗
(releases []*release.Release, timeFormat string, noHeaders bool, noColor bool)

Source from the content-addressed store, hash-verified

156}
157
158func newReleaseListWriter(releases []*release.Release, timeFormat string, noHeaders bool, noColor bool) *releaseListWriter {
159 // Initialize the array so no results returns an empty array instead of null
160 elements := make([]releaseElement, 0, len(releases))
161 for _, r := range releases {
162 element := releaseElement{
163 Name: r.Name,
164 Namespace: r.Namespace,
165 Revision: strconv.Itoa(r.Version),
166 Status: r.Info.Status.String(),
167 Chart: formatChartName(r.Chart),
168 AppVersion: formatAppVersion(r.Chart),
169 }
170
171 t := "-"
172 if tspb := r.Info.LastDeployed; !tspb.IsZero() {
173 if timeFormat != "" {
174 t = tspb.Format(timeFormat)
175 } else {
176 t = tspb.String()
177 }
178 }
179 element.Updated = t
180
181 elements = append(elements, element)
182 }
183 return &releaseListWriter{elements, noHeaders, noColor}
184}
185
186func (w *releaseListWriter) WriteTable(out io.Writer) error {
187 table := uitable.New()

Callers 4

TestReleaseListWriterFunction · 0.85
TestListStatusMappingFunction · 0.85
newListCmdFunction · 0.85

Calls 3

formatChartNameFunction · 0.85
formatAppVersionFunction · 0.85
StringMethod · 0.45

Tested by 3

TestReleaseListWriterFunction · 0.68
TestListStatusMappingFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…