printDryRunSummary prints what would be created without sending anything.
(opts *CreateOptions)
| 143 | |
| 144 | // printDryRunSummary prints what would be created without sending anything. |
| 145 | func printDryRunSummary(opts *CreateOptions) error { |
| 146 | name, err := resolveName(opts) |
| 147 | if err != nil { |
| 148 | return err |
| 149 | } |
| 150 | |
| 151 | planLabel := opts.Plan |
| 152 | if planLabel == "" { |
| 153 | planLabel = dashboard.PlanTypeFree |
| 154 | } |
| 155 | summary := map[string]any{ |
| 156 | "action": "create_application", |
| 157 | "name": name, |
| 158 | "region": opts.Region, |
| 159 | "plan": planLabel, |
| 160 | "default": opts.Default, |
| 161 | "dryRun": true, |
| 162 | } |
| 163 | return cmdutil.PrintRunSummary( |
| 164 | opts.IO, |
| 165 | opts.PrintFlags, |
| 166 | summary, |
| 167 | fmt.Sprintf( |
| 168 | "Dry run: would create application %q in region %q on the %q plan", |
| 169 | name, |
| 170 | opts.Region, |
| 171 | planLabel, |
| 172 | ), |
| 173 | ) |
| 174 | } |
| 175 | |
| 176 | // createResult carries what the creation flow produced, for telemetry. |
| 177 | type createResult struct { |
no test coverage detected