Conversation
| isValid: true, | ||
| }, | ||
| { | ||
| description: "routing-table id invalid", |
There was a problem hiding this comment.
since the routing-table-id flag is optional, could we please have a test case without the flag being set or being invalid?
| ipv6DnsNameServersFlag: "2001:4860:4860::8888,2001:4860:4860::8844", | ||
| ipv6GatewayFlag: "2001:4860:4860::8888", | ||
| labelFlag: "key=value", | ||
| routingTableIdFlag: testRoutingTableId, |
There was a problem hiding this comment.
same here, routing table id flag is optional to there must be at least 1 test case IMO which doesn't have it set
| } | ||
|
|
||
| func outputResult(p *print.Printer, outputFormat string, routingTable *iaas.RoutingTable) error { | ||
| if routingTable == nil { |
There was a problem hiding this comment.
This condition can be moved into the callback func for the pretty output, so the JSON/YAML output is the actual API response
| return fmt.Errorf("create routing-table response is empty") | ||
| } | ||
|
|
||
| if routingTable.Id == nil { |
| } | ||
|
|
||
| func outputResult(p *print.Printer, outputFormat, routingTableId, networkAreaId string, route *iaas.Route) error { | ||
| if route == nil { |
There was a problem hiding this comment.
check can be removed, is already present in the pretty output callback func
| return fmt.Errorf("update route response is empty") | ||
| } | ||
|
|
||
| if route.Id == nil || *route.Id == "" { |
There was a problem hiding this comment.
check can be removed, is already present in the pretty output callback func
| return fmt.Errorf("update routing-table response is empty") | ||
| } | ||
|
|
||
| if routingTable.Id == nil { |
There was a problem hiding this comment.
check belongs into pretty output callback func, JSON/YAML output won't have problems with this being nil
Description
reopened #1023
Checklist
make fmtmake generate-docs(will be checked by CI)make test(will be checked by CI)make lint(will be checked by CI)