marcv81 opened a new pull request, #11872:
URL: https://github.com/apache/inlong/pull/11872
If an IP is not available, we use id = 0 instead of crashing.
Fixes #11871
### Motivation
This PR allows programs which import the InLong DataProxy SDK to initialise
properly even if no IP address is available on the system. Modular programs
such as Telegraf may import the InLong SDK, but enable/disable its features in
the configuration. Currently, such programs crash even if the configuration
disables InLong. This PR fixes that.
### Modifications
Trivial, please see the diff. The ID now defaults to 0 if no IP address is
available.
### Verifying this change
*(Please pick either of the following options)*
- [ ] This change is a trivial rework/code cleanup without any test coverage.
- [X] This change is already covered by existing tests, such as:
- happy path: all tests, because the change only impacts the init()
function.
- sad path: I manually verified this PR allows Telegraf to start in a
Docker container with no network.
- [ ] This change added tests and can be verified as follows:
### Documentation
- Does this pull request introduce a new feature? No
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]