Skip to content

Commit

Permalink
Moved --wait-window flag to shared flags
Browse files Browse the repository at this point in the history
  • Loading branch information
vyasgun committed Apr 13, 2022
1 parent fbf9769 commit f13f1e0
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions docs/cmd/kn_broker_delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ kn broker delete NAME
--no-wait Do not wait for 'broker delete' operation to be completed. (default true)
--wait Wait for 'broker delete' operation to be completed.
--wait-timeout int Seconds to wait before giving up on waiting for broker to be deleted. (default 600)
--wait-window int Seconds to wait for broker to be deleted after a false ready condition is returned (default 2)
```

### Options inherited from parent commands
Expand Down
1 change: 1 addition & 0 deletions docs/cmd/kn_revision_delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ kn revision delete NAME [NAME ...]
--prune-all Remove all unreferenced revisions in a namespace.
--wait Wait for 'revision delete' operation to be completed.
--wait-timeout int Seconds to wait before giving up on waiting for revision to be deleted. (default 600)
--wait-window int Seconds to wait for revision to be deleted after a false ready condition is returned (default 2)
```

### Options inherited from parent commands
Expand Down
1 change: 1 addition & 0 deletions docs/cmd/kn_service_apply.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ kn service apply s0 --filename my-svc.yml
--volume stringArray Add a volume from a ConfigMap (prefix cm: or config-map:) or a Secret (prefix secret: or sc:). Example: --volume myvolume=cm:myconfigmap or --volume myvolume=secret:mysecret. You can use this flag multiple times. To unset a ConfigMap/Secret reference, append "-" to the name, e.g. --volume myvolume-.
--wait Wait for 'service apply' operation to be completed. (default true)
--wait-timeout int Seconds to wait before giving up on waiting for service to be ready. (default 600)
--wait-window int Seconds to wait for service to be ready after a false ready condition is returned (default 2)
```

### Options inherited from parent commands
Expand Down
1 change: 1 addition & 0 deletions docs/cmd/kn_service_delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ kn service delete NAME [NAME ...]
--target string Work on local directory instead of a remote cluster (experimental)
--wait Wait for 'service delete' operation to be completed.
--wait-timeout int Seconds to wait before giving up on waiting for service to be deleted. (default 600)
--wait-window int Seconds to wait for service to be deleted after a false ready condition is returned (default 2)
```

### Options inherited from parent commands
Expand Down
1 change: 1 addition & 0 deletions docs/cmd/kn_service_import.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ kn service import FILENAME
--no-wait Do not wait for 'service import' operation to be completed.
--wait Wait for 'service import' operation to be completed. (default true)
--wait-timeout int Seconds to wait before giving up on waiting for service to be ready. (default 600)
--wait-window int Seconds to wait for service to be ready after a false ready condition is returned (default 2)
```

### Options inherited from parent commands
Expand Down
1 change: 1 addition & 0 deletions docs/cmd/kn_service_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ kn service update NAME
--volume stringArray Add a volume from a ConfigMap (prefix cm: or config-map:) or a Secret (prefix secret: or sc:). Example: --volume myvolume=cm:myconfigmap or --volume myvolume=secret:mysecret. You can use this flag multiple times. To unset a ConfigMap/Secret reference, append "-" to the name, e.g. --volume myvolume-.
--wait Wait for 'service update' operation to be completed. (default true)
--wait-timeout int Seconds to wait before giving up on waiting for service to be ready. (default 600)
--wait-window int Seconds to wait for service to be ready after a false ready condition is returned (default 2)
```

### Options inherited from parent commands
Expand Down
1 change: 0 additions & 1 deletion pkg/kn/commands/service/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ func NewServiceCreateCommand(p *commands.KnParams) *cobra.Command {
editFlags.AddCreateFlags(serviceCreateCommand)
trafficFlags.AddTagFlag(serviceCreateCommand)
waitFlags.AddConditionWaitFlags(serviceCreateCommand, commands.WaitDefaultTimeout, "create", "service", "ready")
waitFlags.AddErrorWindow(serviceCreateCommand, "service", "ready")
return serviceCreateCommand
}

Expand Down
4 changes: 0 additions & 4 deletions pkg/kn/commands/wait_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,7 @@ func (p *WaitFlags) AddConditionWaitFlags(command *cobra.Command, waitTimeoutDef
knflags.AddBothBoolFlagsUnhidden(command.Flags(), &p.Wait, "wait", "", waitDefault, waitUsage)
timeoutUsage := fmt.Sprintf("Seconds to wait before giving up on waiting for %s to be %s.", what, until)
command.Flags().IntVar(&p.TimeoutInSeconds, "wait-timeout", waitTimeoutDefault, timeoutUsage)
}

// AddErrorWindow will add a flag to configure the error window, that is,
// the time to wait between intermediate false ready conditions
func (p *WaitFlags) AddErrorWindow(command *cobra.Command, what, until string) {
windowUsage := fmt.Sprintf("Seconds to wait for %s to be %s after a false ready condition is returned", what, until)
command.Flags().IntVar(&p.ErrorWindowInSeconds, "wait-window", 2, windowUsage)
}

0 comments on commit f13f1e0

Please sign in to comment.