mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-10-15 19:42:06 +00:00
fix: do not attempt to run the LXC stop script with self-hosted (#1037)
The test is covered by TestRunnerLXC which verifies the script actually runs on LXC. Resolves forgejo/runner#1035 <!--start release-notes-assistant--> <!--URL:https://code.forgejo.org/forgejo/runner--> - bug fixes - [PR](https://code.forgejo.org/forgejo/runner/pulls/1037): <!--number 1037 --><!--line 0 --><!--description Zml4OiBkbyBub3QgYXR0ZW1wdCB0byBydW4gdGhlIExYQyBzdG9wIHNjcmlwdCB3aXRoIHNlbGYtaG9zdGVk-->fix: do not attempt to run the LXC stop script with self-hosted<!--description--> <!--end release-notes-assistant--> Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/1037 Reviewed-by: fnetX <fnetx@noreply.code.forgejo.org> Reviewed-by: Michael Kriese <michael.kriese@gmx.de> Reviewed-by: Mathieu Fenniak <mfenniak@noreply.code.forgejo.org> Co-authored-by: Earl Warren <contact@earl-warren.org> Co-committed-by: Earl Warren <contact@earl-warren.org>
This commit is contained in:
parent
ea824bde1c
commit
7f90c8acb2
1 changed files with 4 additions and 0 deletions
|
@ -254,6 +254,10 @@ func (rc *RunContext) stopHostEnvironment(ctx context.Context) error {
|
|||
logger := common.Logger(ctx)
|
||||
logger.Debugf("stopHostEnvironment")
|
||||
|
||||
if !rc.IsLXCHostEnv(ctx) {
|
||||
return nil
|
||||
}
|
||||
|
||||
var stopScript bytes.Buffer
|
||||
if err := stopTemplate.Execute(&stopScript, struct {
|
||||
Name string
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue