Include annotations in helm get metadata

Signed-off-by: MichaelMorris <michael.morris@est.tech>
pull/12700/head
MichaelMorris 2 years ago
parent 7fd08041b1
commit 66a1bea31c

@ -82,6 +82,8 @@ func (w metadataWriter) WriteTable(out io.Writer) error {
_, _ = fmt.Fprintf(out, "REVISION: %v\n", w.metadata.Revision)
_, _ = fmt.Fprintf(out, "STATUS: %v\n", w.metadata.Status)
_, _ = fmt.Fprintf(out, "DEPLOYED_AT: %v\n", w.metadata.DeployedAt)
_, _ = fmt.Fprintf(out, "ANNOTATIONS: %v\n", w.metadata.Annotations)
return nil
}

@ -36,6 +36,7 @@ type Metadata struct {
Revision int `json:"revision" yaml:"revision"`
Status string `json:"status" yaml:"status"`
DeployedAt string `json:"deployedAt" yaml:"deployedAt"`
Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
}
// NewGetMetadata creates a new GetMetadata object with the given configuration.
@ -65,5 +66,6 @@ func (g *GetMetadata) Run(name string) (*Metadata, error) {
Revision: rel.Version,
Status: rel.Info.Status.String(),
DeployedAt: rel.Info.LastDeployed.Format(time.RFC3339),
Annotations: rel.Chart.Metadata.Annotations,
}, nil
}

Loading…
Cancel
Save