Skip to content
This repository was archived by the owner on Jan 8, 2024. It is now read-only.

Commit 8debf26

Browse files
Merge pull request #4770 from hashicorp/i-config-workspace-scope-flag
Remove `-workspace-scope` flag on `config set` and `config delete`
2 parents 5cca8c2 + d899238 commit 8debf26

File tree

10 files changed

+27
-48
lines changed

10 files changed

+27
-48
lines changed

.changelog/4770.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
```release-note:improvement
2+
cli: Use -w flag for workspace scoping on `config set` and `config delete`,
3+
instead of `workspace-scope`.
4+
```

embedJson/gen/platform-aws-ecs.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@
448448
"Field": "health_check",
449449
"Type": "ecs.AppHealthCheck",
450450
"Synopsis": "Health check settings for the app.",
451-
"Summary": "",
451+
"Summary": "These settings configure a health check for the application target group.",
452452
"Optional": true,
453453
"Default": "",
454454
"EnvVar": "",
@@ -497,7 +497,7 @@
497497
"Synopsis": "The amount of time, in seconds, between health checks.",
498498
"Summary": "",
499499
"Optional": true,
500-
"Default": "",
500+
"Default": "30",
501501
"EnvVar": "",
502502
"Category": false,
503503
"Example": "",
@@ -542,10 +542,10 @@
542542
{
543543
"Field": "timeout",
544544
"Type": "int64",
545-
"Synopsis": "The amount of time, in seconds, for which no target response means a failure.",
545+
"Synopsis": "The amount of time, in seconds, for which no target response means a failure. Must be lower than the interval.",
546546
"Summary": "",
547547
"Optional": true,
548-
"Default": "",
548+
"Default": "5",
549549
"EnvVar": "",
550550
"Category": false,
551551
"Example": "",

internal/cli/config_delete.go

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@ import (
1919
type ConfigDeleteCommand struct {
2020
*baseCommand
2121

22-
flagGlobal bool
23-
flagScope string
24-
flagWorkspaceScope string
25-
flagLabelScope string
22+
flagGlobal bool
23+
flagScope string
24+
flagLabelScope string
2625
}
2726

2827
func (c *ConfigDeleteCommand) Run(args []string) int {
@@ -128,7 +127,7 @@ func (c *ConfigDeleteCommand) Run(args []string) int {
128127
}
129128

130129
// If we have a workspace flag set, set that.
131-
if v := c.flagWorkspaceScope; v != "" {
130+
if v := c.flagWorkspace; v != "" {
132131
configVar.Target.Workspace = &pb.Ref_Workspace{
133132
Workspace: v,
134133
}
@@ -164,16 +163,6 @@ func (c *ConfigDeleteCommand) Flags() *flag.Sets {
164163
Default: "project",
165164
})
166165

167-
f.StringVar(&flag.StringVar{
168-
Name: "workspace-scope",
169-
Target: &c.flagWorkspaceScope,
170-
Usage: "Specify that the configuration is only available within a " +
171-
"specific workspace. This configuration will only be deleted for " +
172-
"deployments or operations when the workspace " +
173-
"matches this.",
174-
Default: "",
175-
})
176-
177166
f.StringVar(&flag.StringVar{
178167
Name: "label-scope",
179168
Target: &c.flagLabelScope,

internal/cli/config_set.go

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ import (
99
"os"
1010
"strings"
1111

12+
"github.com/posener/complete"
13+
1214
"github.com/hashicorp/waypoint-plugin-sdk/terminal"
1315
"github.com/hashicorp/waypoint/internal/clierrors"
1416
"github.com/hashicorp/waypoint/internal/pkg/flag"
1517
pb "github.com/hashicorp/waypoint/pkg/server/gen"
16-
"github.com/posener/complete"
1718
)
1819

1920
type ConfigSetCommand struct {
2021
*baseCommand
2122

22-
flagGlobal bool
23-
flagRunner bool
24-
flagScope string
25-
flagWorkspaceScope string
26-
flagLabelScope string
23+
flagGlobal bool
24+
flagRunner bool
25+
flagScope string
26+
flagLabelScope string
2727
}
2828

2929
func (c *ConfigSetCommand) Run(args []string) int {
@@ -147,7 +147,7 @@ func (c *ConfigSetCommand) Run(args []string) int {
147147
//TODO: update to add flag to target runner by workspace and labels
148148

149149
// If we have a workspace flag set, set that.
150-
if v := c.flagWorkspaceScope; v != "" {
150+
if v := c.flagWorkspace; v != "" {
151151
configVar.Target.Workspace = &pb.Ref_Workspace{
152152
Workspace: v,
153153
}
@@ -183,16 +183,6 @@ func (c *ConfigSetCommand) Flags() *flag.Sets {
183183
Default: "project",
184184
})
185185

186-
f.StringVar(&flag.StringVar{
187-
Name: "workspace-scope",
188-
Target: &c.flagWorkspaceScope,
189-
Usage: "Specify that the configuration is only available within a " +
190-
"specific workspace. This configuration will only be set for " +
191-
"deployments or operations (if -runner is set) when the workspace " +
192-
"matches this.",
193-
Default: "",
194-
})
195-
196186
f.StringVar(&flag.StringVar{
197187
Name: "label-scope",
198188
Target: &c.flagLabelScope,

internal/cli/config_source_set.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,5 @@ Usage: waypoint config source-set [options]
162162
source plugin. When modifying an existing configuration, all desired
163163
"-config" flags will need to be set each time the command is ran.
164164
165-
Configuration for this command is global. The "-app", "-project", and
166-
"-workspace" flags are ignored on this command.
167-
168165
` + c.Flags().Help())
169166
}

website/content/commands/config-delete.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ Delete a config variable from the system. This cannot be undone.
2929
#### Command Options
3030

3131
- `-scope=<string>` - The scope for this configuration to delete. The configuration will only delete within this scope. This can be one of 'global', 'project', or 'app'. The default is project.
32-
- `-workspace-scope=<string>` - Specify that the configuration is only available within a specific workspace. This configuration will only be deleted for deployments or operations when the workspace matches this.
3332
- `-label-scope=<string>` - If set, configuration will only be deleted if the deployment or operation has a matching label set.
3433

3534
@include "commands/config-delete_more.mdx"

website/content/commands/config-set.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ Specify the "-app" flag to set a config variable for a specific app.
3737
#### Command Options
3838

3939
- `-scope=<string>` - The scope for this configuration. The configuration will only appear within this scope. This can be one of 'global', 'project', or 'app'. The default is project.
40-
- `-workspace-scope=<string>` - Specify that the configuration is only available within a specific workspace. This configuration will only be set for deployments or operations (if -runner is set) when the workspace matches this.
4140
- `-label-scope=<string>` - If set, configuration will only be set if the deployment or operation (if -runner is set) has a matching label set.
4241
- `-runner` - Expose this configuration on runners. This can be used to set things such as credentials to cloud platforms for remote runners. This configuration will not be exposed to deployed applications. If this is specified in the context of a project, this will apply only to runners operating on jobs for the specific project or application. The default is false.
4342

website/content/commands/config-source-set.mdx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ This command overrides all configuration already set for a configuration
3232
source plugin. When modifying an existing configuration, all desired
3333
"-config" flags will need to be set each time the command is ran.
3434

35-
Configuration for this command is global. The "-app", "-project", and
36-
"-workspace" flags are ignored on this command.
37-
3835
#### Global Options
3936

4037
- `-plain` - Plain output: no colors, no animation. The default is false.

website/content/docs/runner/config.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ secrets on the Waypoint server, you must set the environment variables manually
4646
[manually running the runner](/waypoint/docs/runner/run-manual).
4747

4848
You can use the `-scope` flag paired with flags such as `-project`,
49-
`-label-scope`, and `-workspace-scope` to set runner variables that are only
49+
`-label-scope`, and `-workspace` to set runner variables that are only
5050
available within certain scoped situations. Unscoped variables are globally sent to
5151
all runners.
5252

@@ -62,9 +62,9 @@ submit jobs to the `prod` namespace for the `prod` Waypoint workspace. Here's wh
6262
that could look like:
6363

6464
```shell-session
65-
$ waypoint config set -runner -workspace-scope=dev NOMAD_TOKEN=abc123
65+
$ waypoint config set -runner -workspace=dev NOMAD_TOKEN=abc123
6666
67-
$ waypoint config set -runner -workspace-scope=prod NOMAD_TOKEN=def456
67+
$ waypoint config set -runner -workspace=prod NOMAD_TOKEN=def456
6868
6969
$ waypoint config get -runner
7070
SCOPE | NAME | VALUE | WORKSPACE | LABELS

website/content/partials/components/platform-aws-ecs.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ Set along with alb.domain_name to have DNS automatically setup for the ALB.
9494

9595
Health check settings for the app.
9696

97+
These settings configure a health check for the application target group.
98+
9799
- **Optional**
98100

99101
##### health_check.grpc_code
@@ -120,6 +122,7 @@ The amount of time, in seconds, between health checks.
120122

121123
- Type: **int64**
122124
- **Optional**
125+
- Default: 30
123126

124127
##### health_check.matcher
125128

@@ -142,10 +145,11 @@ The protocol for the health check to use.
142145

143146
##### health_check.timeout
144147

145-
The amount of time, in seconds, for which no target response means a failure.
148+
The amount of time, in seconds, for which no target response means a failure. Must be lower than the interval.
146149

147150
- Type: **int64**
148151
- **Optional**
152+
- Default: 5
149153

150154
##### health_check.unhealthy_threshold_count
151155

0 commit comments

Comments
 (0)