Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
johnstcn merged 8 commits intomainfromcj/provisioner-daemon-name
Dec 7, 2023

Conversation

johnstcn
Copy link
Member

@johnstcnjohnstcn commentedDec 7, 2023
edited
Loading

Part of#10676

  • Adds a--name argument toprovisionerd start
  • Plumbs through name to integrated and external provisioners
  • Defaults tohostname if not specified for external,hostname-N for integrated
  • Addscliutil.Hostname

@johnstcnjohnstcn self-assigned thisDec 7, 2023
@johnstcnjohnstcn marked this pull request as ready for reviewDecember 7, 2023 12:32
Copy link
Member

@mtojekmtojek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Quick look

@@ -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)
Copy link
Member

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?

Copy link
MemberAuthor

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.

mtojek reacted with thumbs up emoji
if len(hostname+suffix) > 62 {
hostname = hostname[:62-len(suffix)]
}
name := fmt.Sprintf("%s-%s", hostname, suffix)
Copy link
Member

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)?

Copy link
MemberAuthor

@johnstcnjohnstcnDec 7, 2023
edited
Loading

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.

@johnstcnjohnstcn merged commit1e349f0 intomainDec 7, 2023
@johnstcnjohnstcn deleted the cj/provisioner-daemon-name branchDecember 7, 2023 16:59
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsDec 7, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@mafredrimafredrimafredri approved these changes

@mtojekmtojekmtojek approved these changes

@spikecurtisspikecurtisAwaiting requested review from spikecurtis

Assignees

@johnstcnjohnstcn

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@johnstcn@mafredri@mtojek

[8]ページ先頭

©2009-2025 Movatter.jp