Skip to content

Commit 63f0249

Browse files
authored
deployment: Add --plan-history flag to show cmd (#198)
Adds a `--plan-history` flag to `ecctl deployment show` to be able to obtain the Deployment's plan history. Signed-off-by: Marc Lopez <marc5.12@outlook.com>
1 parent a9212ae commit 63f0249

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

cmd/deployment/show.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,11 @@ var showCmd = &cobra.Command{
5151

5252
planLogs, _ := cmd.Flags().GetBool("plan-logs")
5353
planDefaults, _ := cmd.Flags().GetBool("plan-defaults")
54+
planHistory, _ := cmd.Flags().GetBool("plan-history")
5455
metadata, _ := cmd.Flags().GetBool("metadata")
5556
settings, _ := cmd.Flags().GetBool("settings")
5657
plans, _ := cmd.Flags().GetBool("plans")
57-
showPlans := planLogs || planDefaults || plans
58+
showPlans := planLogs || planDefaults || plans || planHistory
5859

5960
refID, _ := cmd.Flags().GetString("ref-id")
6061
getParams := deployment.GetParams{
@@ -65,6 +66,7 @@ var showCmd = &cobra.Command{
6566
ShowPlans: showPlans,
6667
ShowPlanLogs: planLogs,
6768
ShowPlanDefaults: planDefaults,
69+
ShowPlanHistory: planHistory,
6870
ShowMetadata: metadata,
6971
ShowSettings: settings,
7072
},
@@ -89,6 +91,7 @@ func init() {
8991
showCmd.Flags().Bool("plans", false, "Shows the deployment plans")
9092
showCmd.Flags().Bool("plan-logs", false, "Shows the deployment plan logs")
9193
showCmd.Flags().Bool("plan-defaults", false, "Shows the deployment plan defaults")
94+
showCmd.Flags().Bool("plan-history", false, "Shows the deployment plan history")
9295
showCmd.Flags().BoolP("metadata", "m", false, "Shows the deployment metadata")
9396
showCmd.Flags().BoolP("settings", "s", false, "Shows the deployment settings")
9497
}

docs/ecctl_deployment_show.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ ecctl deployment show <deployment-id> [flags]
2727
-h, --help help for show
2828
-m, --metadata Shows the deployment metadata
2929
--plan-defaults Shows the deployment plan defaults
30+
--plan-history Shows the deployment plan history
3031
--plan-logs Shows the deployment plan logs
3132
--plans Shows the deployment plans
3233
--ref-id string Optional deployment type RefId, if not set, the RefId will be auto-discovered

pkg/deployment/deputil/deputil.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ type QueryParams struct {
101101
ShowPlans bool
102102
ShowPlanDefaults bool
103103
ShowPlanLogs bool
104+
ShowPlanHistory bool
104105
ShowMetadata bool
105106
ShowSettings bool
106107

pkg/deployment/get.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ func Get(params GetParams) (*models.DeploymentGetResponse, error) {
6969
WithShowPlans(ec.Bool(params.ShowPlans)).
7070
WithShowPlanDefaults(ec.Bool(params.ShowPlanDefaults)).
7171
WithShowPlanLogs(ec.Bool(params.ShowPlanLogs)).
72+
WithShowPlanHistory(ec.Bool(params.ShowPlanHistory)).
7273
WithShowMetadata(ec.Bool(params.ShowMetadata)).
7374
WithShowSettings(ec.Bool(params.ShowSettings)).
7475
WithShowSystemAlerts(systemAlerts),

0 commit comments

Comments
 (0)