9 Commits

Author SHA1 Message Date
Aaron U'Ren
fcdb0ed8ae fix(node.go): embed root cause errors in returned errors 2025-12-02 18:03:34 -06:00
Aaron U'Ren
2896ae4d1a fix(node_test.go): some minor unit test errors & verbiage 2024-11-21 15:24:09 +01:00
Aaron U'Ren
5e4db3fa33 test(krnode): add unit tests for new functionality 2024-09-29 17:53:36 -05:00
Aaron U'Ren
9fd46cc86d fact(krnode): add node struct abstraction
This prepares the way for broader refactors in the way that we handle
nodes by:

* Separating frequently used node logic from the controller creation
  steps
* Keeping reused code DRY-er
* Adding interface abstractions for key groups of node data and starting
  to rely on those more rather than concrete types
* Separating node data from the rest of the controller data structure so
  that it smaller definitions of data can be passed around to functions
  that need it rather than always passing the entire controller which
  contains more data / surface area than most functions need.
2024-09-29 17:53:36 -05:00
Aaron U'Ren
7755b4a67f fix(node.go): improve logic for GetNodeObject
Before the logic ran like the following in terms of preference:

1. Prefer environment var NODE_NAME
2. `Use os.Hostname()`
3. Fallback to `--hostname-override` passed by user

This didn't make a whole lot of sense, as `--hostname-override` is
directly, and supposedly intentionally set by the user, therefore it
should be the MOST preferred, not the least preferred. Additionally,
none of the errors encountered were passed back to the user so that
future conditions could be considered, so if there was an error at the
API level, that error was swallowed. Now the logic looks like:

1. Prefer `--hostname-override` if it is set. If it is set and we
   weren't able to resolve to a node object, return the error
2. Use environment var NODE_NAME if it is set. If it is set and we
   weren't able to resolve to a node object, return the error
3. Fallback to `os.Hostname()`. If we weren't able to resolve to a node
   object then return the error and give the user options
2024-04-26 14:16:09 -05:00
Aaron U'Ren
ddb0e63c46 feat(NRC): make NRC dual stack 2023-10-07 08:52:31 -05:00
Aaron U'Ren
96675e620b fix: don't capitalize error messages
It is standard practice in Go to not capitalize error messages:
https://github.com/golang/go/wiki/CodeReviewComments#error-strings
2021-04-14 16:23:59 -05:00
Murali Reddy
3c734fb96a
merge gobgp-update into master (#982)
* merge gobgp-update into master

* update travis.yaml go version:

* go get github.com/osrg/gobgp to build gobgp

* install git as go get needs it
2020-09-07 10:27:58 +05:30
Murali Reddy
71d16bf4d6
code restructuring as per typical golang projects (#397)
* code restructuring as per typical golang projects

* fix link in docs
2018-04-17 00:18:20 +05:30