mirror of https://github.com/helm/helm
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
877 B
45 lines
877 B
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"time"
|
|
|
|
"github.com/kubernetes/helm/pkg/helm"
|
|
"github.com/kubernetes/helm/pkg/timeconv"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var statusHelp = `
|
|
This command shows the status of a named release.
|
|
`
|
|
|
|
var statusCommand = &cobra.Command{
|
|
Use: "status [flags] RELEASE_NAME",
|
|
Short: "Displays the status of the named release",
|
|
Long: statusHelp,
|
|
RunE: status,
|
|
}
|
|
|
|
func init() {
|
|
RootCommand.AddCommand(statusCommand)
|
|
}
|
|
|
|
func status(cmd *cobra.Command, args []string) error {
|
|
if len(args) == 0 {
|
|
return errReleaseRequired
|
|
}
|
|
|
|
res, err := helm.GetReleaseStatus(args[0])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
fmt.Printf("Last Deployed: %s\n", timeconv.Format(res.Info.LastDeployed, time.ANSIC))
|
|
fmt.Printf("Status: %s\n", res.Info.Status.Code)
|
|
if res.Info.Status.Details != nil {
|
|
fmt.Printf("Details: %s\n", res.Info.Status.Details)
|
|
}
|
|
|
|
return nil
|
|
}
|