parseCLIIngress constructs an Ingress set with only one rule constructed from CLI parameters: --url, --hello-world, --bastion, or --unix-socket
(c *cli.Context, allowURLFromArgs bool)
| 128 | // parseCLIIngress constructs an Ingress set with only one rule constructed from |
| 129 | // CLI parameters: --url, --hello-world, --bastion, or --unix-socket |
| 130 | func parseCLIIngress(c *cli.Context, allowURLFromArgs bool) (Ingress, error) { |
| 131 | service, err := parseSingleOriginService(c, allowURLFromArgs) |
| 132 | if err != nil { |
| 133 | return Ingress{}, err |
| 134 | } |
| 135 | |
| 136 | // Construct an Ingress with the single rule. |
| 137 | defaults := originRequestFromSingleRule(c) |
| 138 | ing := Ingress{ |
| 139 | Rules: []Rule{ |
| 140 | { |
| 141 | Service: service, |
| 142 | Config: setConfig(defaults, config.OriginRequestConfig{}), |
| 143 | }, |
| 144 | }, |
| 145 | Defaults: defaults, |
| 146 | } |
| 147 | return ing, err |
| 148 | } |
| 149 | |
| 150 | // newDefaultOrigin always returns a 503 response code to help indicate that there are no ingress |
| 151 | // rules setup, but the tunnel is reachable. |