Skip to content

Commit 9cca82c

Browse files
committed
run restorecon after materialising files
1 parent f9c2521 commit 9cca82c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pkg-new/hostutils/initialize.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"fmt"
66
"os"
7+
"os/exec"
78
"path/filepath"
89

910
"github.com/replicatedhq/embedded-cluster/pkg/runtimeconfig"
@@ -39,6 +40,17 @@ func (h *HostUtils) ConfigureHost(ctx context.Context, rc runtimeconfig.RuntimeC
3940
}
4041
}
4142

43+
h.logger.Debugln("checking for restorecon binary in $PATH")
44+
if _, err := exec.LookPath("restorecon"); err != nil {
45+
h.logger.Debugln("restorecon not found")
46+
} else {
47+
out, err := exec.Command("restorecon", "-RvF", rc.EmbeddedClusterHomeDirectory()).CombinedOutput()
48+
if err != nil {
49+
h.logger.Debugf("unable to run restorecon: %v", err)
50+
h.logger.Debugln(out)
51+
}
52+
}
53+
4254
h.logger.Debugf("configuring sysctl")
4355
if err := h.ConfigureSysctl(); err != nil {
4456
h.logger.Debugf("unable to configure sysctl: %v", err)

0 commit comments

Comments
 (0)