-
Notifications
You must be signed in to change notification settings - Fork 672
Conversation
Just for reference, this is meant to address #369. |
Referring to this new piece of data as 'hostname' is wrong; it could be anything, and in many cases will not be the hostname. Yes, I know #369 calls it 'hostname', but I didn't file that issue ;) And yes, we really, really must be able to pass that thing into |
Understood. Do you have a preference on what you'd like it to be called? |
I am sure I do, but I don't know what it is :) |
'displayname'? Not great, so happy to consider alternatives. |
log.Fatal(err) | ||
} | ||
if osHostName == "" { | ||
hostName = "<unknown>" |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
I was just about to suggest that or friendlyname, informalname.... |
router := weave.NewRouter(iface, ourName, []byte(password), connLimit, bufSz*1024*1024, logFrame) | ||
log.Println("Our name is", router.Ourself.Name) | ||
router := weave.NewRouter(iface, ourName, hostName, []byte(password), connLimit, bufSz*1024*1024, logFrame) | ||
log.Println("Our name is", router.Ourself.Name, "(" + hostName + ")") |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
'friendlyname' is quite nice. let's invite @bboreham to help paint this particular bike shed :) |
If I may join the bike-shedding, what about "nickname"? |
I do like 'nickname'. |
Accept -nickname parameter to weave script
Addressed comments to date! |
The new option needs to added to the docs. Somewhere. |
Just thinking about the default value of the nickname - would |
Ouch, |
That is surprising. Bash has a With respect to the other issue (short hostname vs FQDN) I suspect the latter is going to be useful if folks have naming schemes like |
Can anybody think of a downside to using FQDNs? @bboreham |
When I thought of this originally, I meant the "hostname" of the container. So we didn't have to implement any flag-parsing, because |
The hostname of the weave container is not exactly meaningful. |
It defaults to the container ID, which I usually know when testing, and I can set to anything else I feel like. So it is meaningful to me. |
setting it to anything else is not exactly straightforward |
I seem to be missing this part. Extra args in |
extra args to |
Aha. I think that belongs as a comment to #369. |
you'd have to use |
Perhaps, but in case of EC2, the FQDN also tells you the region, which is useful. What's your objection to using the FQDN by default? That it can be quite long and thus clutter the output? I can see how that could be annoying, but IMO the default should favour uniqueness & more info over compactness. As you say, it's easy to override by supplying |
@@ -86,7 +86,11 @@ The terms used here are explained further at | |||
[how it works](how-it-works.html). | |||
|
|||
The 'Our name' line identifies the local weave router as a peer in the | |||
weave network. | |||
weave network. It displays both the peer name and the peer's nickname | |||
in parenthesis; the peer name defaults to a MAC address, whilst the |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
IF we are going with |
Go question - which is preferred?
Assigning directly to nickName (NB using '=' instead of ':='); now we're depending upon and overwriting an earlier 'err' declaration:
Explicitly shadow err:
Unfortunately this doesn't work because the inner
|
Getting the FQDN in pure Go is doable:
(Obviously both
Which looks to me like the
|
The 2nd one. Nothing wrong with re-using
That's horrific. going via reverse lookup. Yuck. |
:) As far as I am aware, this is exactly what |
Shelling out to |
Sure. If we want to undo all the work we've done to avoid using the native resolver libraries. Oh and to produce an image containing just a single executable. I'm afraid |
I was half joking, but learned something useful! Is the desire to avoid the resolver related to the warnings in #5?
In that case as far as I am aware the currently implemented behaviour matches the now finalised requirements... |
Yes. But off-topic. |
@@ -19,7 +19,7 @@ type mockChannelConnection struct { | |||
// We need to create some dummy channels otherwise tests hang on nil | |||
// channels when Router.OnGossip() calls async methods. | |||
func NewTestRouter(name PeerName) *Router { | |||
router := NewRouter(nil, name, nil, 10, 1024, nil) | |||
router := NewRouter(nil, name, "hostname", nil, 10, 1024, nil) |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
Above commits address comments to date. |
You missed a fair few places where "hostname" is used as a nickname in tests. |
Apologies, I neglected to look further afield than the specific file you commented on. Fixed. |
nicknames for weave peers Closes #369.
Implement
-hostname
flag to weave router for inclusion inweave status
:Notes:
weave launch
does not accept user supplied-hostname
as this would require introducinggetopt
or similar into the bash script and given #307 is in the offing it didn't seem prudent; script supplies kernel hostname directly to weave router for now. Please advise if you would like this addressed before merging