-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
machine init: validate machine name and username #21692
Conversation
Remove unnecessary type redirection and just make it a normal function. Also unexport it and move the test as it does not need to be public and remove the default value assignments from the struct. Signed-off-by: Paul Holzinger <[email protected]>
This function has to read/write the connections file as such it should only ever be called once otherwise we read/write the same file twice which makes no sense. Also cleanup the fucntion a bit and make it private as there are no external callers. Signed-off-by: Paul Holzinger <[email protected]>
Validate the names with our name regex that we also use for containers/pods. While we technically do not need to be that strict, I think it makes sense to match containers. The most important bit of this validation is that we exclude the use of / and \ which breaks all our file paths as we just use this in the name an when machine write the file it ends up being in a subdir which breaks the reading side. Also other special characters could cause trouble for the URL parsing in the machine connection URL. Signed-off-by: Paul Holzinger <[email protected]>
Ephemeral COPR build failed. @containers/packit-build please check. |
LGTM |
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.
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: flouthoc, Luap99 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
fbb4d5d
into
containers:main
Validate the names with our name regex that we also use for
containers/pods. While we technically do not need to be that strict, I
think it makes sense to match containers. The most important bit of this
validation is that we exclude the use of / and \ which breaks all our
file paths as we just use this in the name an when machine write the
file it ends up being in a subdir which breaks the reading side. Also
other special characters could cause trouble for the URL parsing in the
machine connection URL.
also see the other cleanup commits
Does this PR introduce a user-facing change?