- Notifications
You must be signed in to change notification settings - Fork923
feat(cli): allow specifying name of provisioner daemon#11077
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Quick look
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
@@ -198,6 +200,7 @@ func (c *Client) ServeProvisionerDaemon(ctx context.Context, req ServeProvisione | |||
} | |||
query := serverURL.Query() | |||
query.Add("id", req.ID.String()) | |||
query.Add("name", req.Name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
curious: is it required to pass ID and name now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I think I'm going to end up ignoring the ID parameter and just upserting based on name in a follow-up PR.
Uh oh!
There was an error while loading.Please reload this page.
if len(hostname+suffix) > 62 { | ||
hostname = hostname[:62-len(suffix)] | ||
} | ||
name := fmt.Sprintf("%s-%s", hostname, suffix) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Itshould not, but it turns out that you can write whatever you want to/proc/sys/kernel/hostname
. Thehostname
command will validate its input, but it looks likedocker
will happily accept whatever you give it.
If we trim, we run the risk of collisions between machines namedfoo/bar
,foo~bar
, andfoo!"£$%^&*()_+{}~@:?,bar
. I'm leaning towards not sanitizing this.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Part of#10676
--name
argument toprovisionerd start
hostname
if not specified for external,hostname-N
for integratedcliutil.Hostname