(out io.Writer)
| 77 | } |
| 78 | |
| 79 | func (w metadataWriter) WriteTable(out io.Writer) error { |
| 80 | |
| 81 | formatApplyMethod := func(applyMethod string) string { |
| 82 | switch applyMethod { |
| 83 | case "": |
| 84 | return "client-side apply (defaulted)" |
| 85 | case string(release.ApplyMethodClientSideApply): |
| 86 | return "client-side apply" |
| 87 | case string(release.ApplyMethodServerSideApply): |
| 88 | return "server-side apply" |
| 89 | default: |
| 90 | return fmt.Sprintf("unknown (%q)", applyMethod) |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | _, _ = fmt.Fprintf(out, "NAME: %v\n", w.metadata.Name) |
| 95 | _, _ = fmt.Fprintf(out, "CHART: %v\n", w.metadata.Chart) |
| 96 | _, _ = fmt.Fprintf(out, "VERSION: %v\n", w.metadata.Version) |
| 97 | _, _ = fmt.Fprintf(out, "APP_VERSION: %v\n", w.metadata.AppVersion) |
| 98 | _, _ = fmt.Fprintf(out, "ANNOTATIONS: %v\n", k8sLabels.Set(w.metadata.Annotations).String()) |
| 99 | _, _ = fmt.Fprintf(out, "LABELS: %v\n", k8sLabels.Set(w.metadata.Labels).String()) |
| 100 | _, _ = fmt.Fprintf(out, "DEPENDENCIES: %v\n", w.metadata.FormattedDepNames()) |
| 101 | _, _ = fmt.Fprintf(out, "NAMESPACE: %v\n", w.metadata.Namespace) |
| 102 | _, _ = fmt.Fprintf(out, "REVISION: %v\n", w.metadata.Revision) |
| 103 | _, _ = fmt.Fprintf(out, "STATUS: %v\n", w.metadata.Status) |
| 104 | _, _ = fmt.Fprintf(out, "DEPLOYED_AT: %v\n", w.metadata.DeployedAt) |
| 105 | _, _ = fmt.Fprintf(out, "APPLY_METHOD: %v\n", formatApplyMethod(w.metadata.ApplyMethod)) |
| 106 | |
| 107 | return nil |
| 108 | } |
| 109 | |
| 110 | func (w metadataWriter) WriteJSON(out io.Writer) error { |
| 111 | return output.EncodeJSON(out, w.metadata) |
nothing calls this directly
no test coverage detected