@@ -34,7 +34,7 @@ import (
3434
3535// Regular expression to used to make sure that the identifier given by the
3636// user is safe and that it there is no risk of SQL injection:
37- var ingressKeyRE = regexp .MustCompile (`^[a-z0-9]{3,4 }$` )
37+ var ingressKeyRE = regexp .MustCompile (`^[a-z0-9]{3,5 }$` )
3838
3939var args struct {
4040 clusterKey string
@@ -47,11 +47,14 @@ var Cmd = &cobra.Command{
4747 Aliases : []string {"route" },
4848 Short : "Edit the additional cluster ingress" ,
4949 Long : "Edit the additional non-default application router for a cluster." ,
50- Example : ` # Make additional ingress private on a cluster named 'mycluster'
51- moactl edit ingress --private --cluster=mycluster
50+ Example : ` # Make additional ingress with ID 'a1b2' private on a cluster named 'mycluster'
51+ moactl edit ingress --private --cluster=mycluster a1b2
5252
53- # Update the router selectors for the additional ingress
54- moactl edit ingress --label-match=foo=bar --cluster=mycluster` ,
53+ # Update the router selectors for the additional ingress with ID 'a1b2'
54+ moactl edit ingress --label-match=foo=bar --cluster=mycluster a1b2
55+
56+ # Update the default ingress using the sub-domain identifier
57+ moactl edit ingress --private=false --cluster=mycluster apps` ,
5558 Run : run ,
5659}
5760
@@ -210,6 +213,12 @@ func run(cmd *cobra.Command, argv []string) {
210213
211214 var ingress * cmv1.Ingress
212215 for _ , item := range ingresses {
216+ if ingressID == "apps" && item .Default () {
217+ ingress = item
218+ }
219+ if ingressID == "apps2" && ! item .Default () {
220+ ingress = item
221+ }
213222 if item .ID () == ingressID {
214223 ingress = item
215224 }
0 commit comments