-
Notifications
You must be signed in to change notification settings - Fork 934
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RFC0027 CLI Support for Generic Per-Route Options [v8] (#3366)
* Add MinVersionPerRouteOpts check for create and update route commands * Route command in the v7/commands * Changed typed route options to an untyped map * Change DisplayText to DisplayWarning for flag spec err * Output an error if at least one option is specified incorrectly * New integration test and adjustments of other tests * Consistent naming: per-route options vs route specific options * Rename least-connections to least-connection --------- Co-authored-by: Clemens Hoffmann <[email protected]>
- Loading branch information
Showing
38 changed files
with
1,401 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package actionerror | ||
|
||
import "fmt" | ||
|
||
// RouteOptionError is returned when a route option was specified in the wrong format | ||
type RouteOptionError struct { | ||
Name string | ||
Host string | ||
DomainName string | ||
Path string | ||
} | ||
|
||
func (e RouteOptionError) Error() string { | ||
return fmt.Sprintf("Route option '%s' for route with host '%s', domain '%s', and path '%s' was specified incorrectly. Please use key-value pair format key=value.", e.Name, e.Host, e.DomainName, e.path()) | ||
} | ||
|
||
func (e RouteOptionError) path() string { | ||
if e.Path == "" { | ||
return "/" | ||
} | ||
return e.Path | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package actionerror | ||
|
||
import "fmt" | ||
|
||
// RouteOptionSupportError is returned when route options are not supported | ||
type RouteOptionSupportError struct { | ||
ErrorText string | ||
} | ||
|
||
func (e RouteOptionSupportError) Error() string { | ||
return fmt.Sprintf("Route option support: '%s'", e.ErrorText) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
actor/v7action/v7actionfakes/fake_cloud_controller_client.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.