| ... | ... |
@@ -8250,6 +8250,7 @@ _oc_create_route_edge() |
| 8250 | 8250 |
flags_with_completion+=("--cert")
|
| 8251 | 8251 |
flags_completion+=("_filedir")
|
| 8252 | 8252 |
flags+=("--hostname=")
|
| 8253 |
+ flags+=("--insecure-policy=")
|
|
| 8253 | 8254 |
flags+=("--key=")
|
| 8254 | 8255 |
flags_with_completion+=("--key")
|
| 8255 | 8256 |
flags_completion+=("_filedir")
|
| ... | ... |
@@ -12539,6 +12539,7 @@ _openshift_cli_create_route_edge() |
| 12539 | 12539 |
flags_with_completion+=("--cert")
|
| 12540 | 12540 |
flags_completion+=("_filedir")
|
| 12541 | 12541 |
flags+=("--hostname=")
|
| 12542 |
+ flags+=("--insecure-policy=")
|
|
| 12542 | 12543 |
flags+=("--key=")
|
| 12543 | 12544 |
flags_with_completion+=("--key")
|
| 12544 | 12545 |
flags_completion+=("_filedir")
|
| ... | ... |
@@ -8411,6 +8411,7 @@ _oc_create_route_edge() |
| 8411 | 8411 |
flags_with_completion+=("--cert")
|
| 8412 | 8412 |
flags_completion+=("_filedir")
|
| 8413 | 8413 |
flags+=("--hostname=")
|
| 8414 |
+ flags+=("--insecure-policy=")
|
|
| 8414 | 8415 |
flags+=("--key=")
|
| 8415 | 8416 |
flags_with_completion+=("--key")
|
| 8416 | 8417 |
flags_completion+=("_filedir")
|
| ... | ... |
@@ -12700,6 +12700,7 @@ _openshift_cli_create_route_edge() |
| 12700 | 12700 |
flags_with_completion+=("--cert")
|
| 12701 | 12701 |
flags_completion+=("_filedir")
|
| 12702 | 12702 |
flags+=("--hostname=")
|
| 12703 |
+ flags+=("--insecure-policy=")
|
|
| 12703 | 12704 |
flags+=("--key=")
|
| 12704 | 12705 |
flags_with_completion+=("--key")
|
| 12705 | 12706 |
flags_completion+=("_filedir")
|
| ... | ... |
@@ -73,6 +73,7 @@ func NewCmdCreateEdgeRoute(fullName string, f *clientcmd.Factory, out io.Writer) |
| 73 | 73 |
kcmdutil.AddOutputFlagsForMutation(cmd) |
| 74 | 74 |
cmd.Flags().String("hostname", "", "Set a hostname for the new route")
|
| 75 | 75 |
cmd.Flags().String("port", "", "Name of the service port or number of the container port the route will route traffic to")
|
| 76 |
+ cmd.Flags().String("insecure-policy", "", "Set an insecure policy for the new route")
|
|
| 76 | 77 |
cmd.Flags().String("service", "", "Name of the service that the new route is exposing")
|
| 77 | 78 |
cmd.MarkFlagRequired("service")
|
| 78 | 79 |
cmd.Flags().String("path", "", "Path that the router watches to route traffic to the service.")
|
| ... | ... |
@@ -130,6 +131,11 @@ func CreateEdgeRoute(f *clientcmd.Factory, out io.Writer, cmd *cobra.Command, ar |
| 130 | 130 |
} |
| 131 | 131 |
route.Spec.TLS.CACertificate = string(caCert) |
| 132 | 132 |
|
| 133 |
+ insecurePolicy := kcmdutil.GetFlagString(cmd, "insecure-policy") |
|
| 134 |
+ if len(insecurePolicy) > 0 {
|
|
| 135 |
+ route.Spec.TLS.InsecureEdgeTerminationPolicy = api.InsecureEdgeTerminationPolicyType(insecurePolicy) |
|
| 136 |
+ } |
|
| 137 |
+ |
|
| 133 | 138 |
route, err = oc.Routes(ns).Create(route) |
| 134 | 139 |
if err != nil {
|
| 135 | 140 |
return err |
| ... | ... |
@@ -164,6 +164,9 @@ os::cmd::expect_success 'oc create route edge test-route --service=frontend' |
| 164 | 164 |
os::cmd::expect_success 'oc delete routes test-route' |
| 165 | 165 |
os::cmd::expect_failure 'oc create route edge new-route' |
| 166 | 166 |
os::cmd::expect_success 'oc delete services frontend' |
| 167 |
+os::cmd::expect_success 'oc create route edge --insecure-policy=Allow --service=foo --port=80' |
|
| 168 |
+os::cmd::expect_success_and_text 'oc get route foo -o jsonpath="{.spec.tls.insecureEdgeTerminationPolicy}"' 'Allow'
|
|
| 169 |
+os::cmd::expect_success 'oc delete routes foo' |
|
| 167 | 170 |
echo "routes: ok" |
| 168 | 171 |
os::test::junit::declare_suite_end |
| 169 | 172 |
|