Skip to content

Commit

Permalink
fix: add rootPath for helm values
Browse files Browse the repository at this point in the history
  • Loading branch information
hysyeah committed Nov 15, 2024
1 parent b3b6895 commit 508a4b4
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion pkg/users/userspace/v1/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ type Creator struct {
const (
USER_SPACE_ROLE = "admin"
MAX_RAND_INT = 1000000
olaresRootPath = "OLARES_ROOT_DIR"
defaultRootPath = "/olares"
)

var (
Expand Down Expand Up @@ -197,6 +199,11 @@ func (c *Creator) installSysApps(ctx context.Context, bflPod *corev1.Pod) error
"username": c.user,
},
}
rootPath := defaultRootPath
if os.Getenv(olaresRootPath) != "" {
rootPath = os.Getenv(olaresRootPath)
}
vals["rootPath"] = rootPath

pvcData, err := c.findPVC(ctx, bflPod.Namespace)
if err != nil {
Expand Down Expand Up @@ -287,7 +294,11 @@ func (c *Creator) installLauncher(ctx context.Context, userspace string) (string
"appKey": k,
"appSecret": s,
}

rootPath := defaultRootPath
if os.Getenv(olaresRootPath) != "" {
rootPath = os.Getenv(olaresRootPath)
}
vals["rootPath"] = rootPath
name := helm.ReleaseName("launcher", c.user)
err := helm.InstallCharts(ctx, c.helmCfg.ActionCfg, c.helmCfg.Settings, name, constants.UserChartsPath+"/launcher", "", userspace, vals)
if err != nil {
Expand Down

0 comments on commit 508a4b4

Please sign in to comment.