This PR prevents endpoint override if endpoint is IP address. This means environment and zone will be ignored in the case of IP address.
Motivation for this PR is to allow running a mock public API server using httptest.
Relevant tests:
$ go test ./... -count=1 -run TestSetEndpointFromContext
ok github.com/exoscale/egoscale 0.003s [no tests to run]
? github.com/exoscale/egoscale/admin [no test files]
? github.com/exoscale/egoscale/generate [no test files]
ok github.com/exoscale/egoscale/v2 0.003s
ok github.com/exoscale/egoscale/v2/api 0.002s [no tests to run]
ok github.com/exoscale/egoscale/v2/oapi 0.003s [no tests to run]
? github.com/exoscale/egoscale/version [no test files
This PR prevents endpoint override if endpoint is IP address. This means
environment
andzone
will be ignored in the case of IP address.Motivation for this PR is to allow running a mock public API server using httptest.
Relevant tests: