feat(cli): allow specifying name of provisioner daemon#11077
Conversation
| } | ||
| query := serverURL.Query() | ||
| query.Add("id", req.ID.String()) | ||
| query.Add("name", req.Name) |
There was a problem hiding this comment.
curious: is it required to pass ID and name now?
There was a problem hiding this comment.
I think I'm going to end up ignoring the ID parameter and just upserting based on name in a follow-up PR.
| if len(hostname+suffix) > 62 { | ||
| hostname = hostname[:62-len(suffix)] | ||
| } | ||
| name := fmt.Sprintf("%s-%s", hostname, suffix) |
There was a problem hiding this comment.
A hostname could include e.g. _, /, --, etc. I believe validation would fail in this case.. should we sanitize (strip/replace/allowlist)?
There was a problem hiding this comment.
It should not, but it turns out that you can write whatever you want to /proc/sys/kernel/hostname. The hostname command will validate its input, but it looks like docker will happily accept whatever you give it.
If we trim, we run the risk of collisions between machines named foo/bar, foo~bar, and foo!"£$%^&*()_+{}~@:?,bar. I'm leaning towards not sanitizing this.
Part of #10676
--nameargument toprovisionerd starthostnameif not specified for external,hostname-Nfor integratedcliutil.Hostname