-
Notifications
You must be signed in to change notification settings - Fork 370
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
Use the correct template when installing as a SystemV service #5044
Conversation
There are no references to this function. Signed-off-by: Kimmo Lehto <[email protected]>
Since k0s does not run on mac, there's no need for launchd service installer. Signed-off-by: Kimmo Lehto <[email protected]>
The file was empty except for the copyright header and package name. Signed-off-by: Kimmo Lehto <[email protected]>
Unlike openrc, upstart and system v unit file templates, the systemd template was defined in pkg/install/service.go. Here it is extracted into a dedicated file like the other templates. Signed-off-by: Kimmo Lehto <[email protected]>
The customized system V service template was not being used, as the template was put into "SystemdScript" option. The correct option name seems to be "SysVScript". Signed-off-by: Kimmo Lehto <[email protected]>
The openrc unit file template had the "name=" definition twice. I assume it is the last one that was effective. Signed-off-by: Kimmo Lehto <[email protected]>
There are no references to this function. The linter catches is as unused. Signed-off-by: Kimmo Lehto <[email protected]>
19b07f6
to
416c9ff
Compare
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 wonder if it would make more sense to put the template into its dedicated file and use go:embed to put it into a string variable somewhere.
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.
There doesn't seem to be an established filename extension for go's text/template format files, if there was, it would be nice for editor benefits.
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.
https://marketplace.visualstudio.com/items?itemName=jinliming2.vscode-go-template
Seems to hint towards using *.go.txt, *.go.tpl, *.go.tmpl, *.gtpl.
Successfully created backport PR for |
Successfully created backport PR for |
Successfully created backport PR for |
Description
Several fixes in separate commits as preparation for #4962
The first one fixes a bug and the PR title has been derived from that. The rest are just housekeeping.
Use SysVScript for system v, not SystemdScript
The customized system V service template from
pkg/install/linux_sysv.go
was not being used, as thetemplate was assigned to
SystemdScript
option. The correct option name seems to beSysVScript
.Remove double "name" field from openrc script
The openrc unit file template had the "name=" definition twice. I assume
it is the last one that was effective.
Extract systemd template to pkg/install/linux_systemd.go
Unlike OpenRC, Upstart and SystemV unit file templates, the systemd
template was defined in
pkg/install/service.go
. Here it has been extractedinto a dedicated file like the other templates.
Remove empty pkg/install/process.go
The file was empty except for the copyright header and package name.
Remove unused darwin launchd integration
Since k0s does not run on mac, there's no need for launchd service
installer.
Remove unused install.GetSysInit() function
There are no references to this function.
Remove unused prepareEnvVars function
There are no references to this function.
Type of change
How Has This Been Tested?
Checklist: