Skip to content

Commit 34c8387

Browse files
authored
✨ Emptydir and setting the workingDir discontinued. (konveyor#327)
There are is no meaningful advantage to mounting the emptyDir over the addon using the containerfs. Mounting the emptyDir and setting (forcing) the workingDir is opinionated in ways that overrides the container configuration. Backwards compatible with _known_ addons. Signed-off-by: Jeff Ortel <[email protected]>
1 parent 1438498 commit 34c8387

File tree

2 files changed

+3
-29
lines changed

2 files changed

+3
-29
lines changed

settings/addon.go

+3-13
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ import (
77
)
88

99
const (
10-
EnvAddonWorkingDir = "ADDON_WORKING_DIR"
11-
EnvHubBaseURL = "HUB_BASE_URL"
12-
EnvHubToken = "TOKEN"
13-
EnvTask = "TASK"
10+
EnvHubBaseURL = "HUB_BASE_URL"
11+
EnvHubToken = "TOKEN"
12+
EnvTask = "TASK"
1413
)
1514

1615
//
@@ -23,11 +22,6 @@ type Addon struct {
2322
// Token for the hub API.
2423
Token string
2524
}
26-
// Path.
27-
Path struct {
28-
// Working directory path.
29-
WorkingDir string
30-
}
3125
//
3226
Task int
3327
}
@@ -43,10 +37,6 @@ func (r *Addon) Load() (err error) {
4337
panic(err)
4438
}
4539
r.Hub.Token, found = os.LookupEnv(EnvHubToken)
46-
r.Path.WorkingDir, found = os.LookupEnv(EnvAddonWorkingDir)
47-
if !found {
48-
r.Path.WorkingDir = "/tmp"
49-
}
5040
if s, found := os.LookupEnv(EnvTask); found {
5141
r.Task, _ = strconv.Atoi(s)
5242
}

task/manager.go

-16
Original file line numberDiff line numberDiff line change
@@ -480,12 +480,6 @@ func (r *Task) pod(addon *crd.Addon, owner *crd.Tackle, secret *core.Secret) (po
480480
//
481481
// specification builds a Pod specification.
482482
func (r *Task) specification(addon *crd.Addon, secret *core.Secret) (specification core.PodSpec) {
483-
working := core.Volume{
484-
Name: "working",
485-
VolumeSource: core.VolumeSource{
486-
EmptyDir: &core.EmptyDirVolumeSource{},
487-
},
488-
}
489483
cache := core.Volume{
490484
Name: "cache",
491485
}
@@ -507,7 +501,6 @@ func (r *Task) specification(addon *crd.Addon, secret *core.Secret) (specificati
507501
r.container(addon, secret),
508502
},
509503
Volumes: []core.Volume{
510-
working,
511504
cache,
512505
},
513506
}
@@ -527,17 +520,12 @@ func (r *Task) container(addon *crd.Addon, secret *core.Secret) (container core.
527520
Name: "main",
528521
Image: r.Image,
529522
ImagePullPolicy: policy,
530-
WorkingDir: Settings.Addon.Path.WorkingDir,
531523
Resources: addon.Spec.Resources,
532524
Env: []core.EnvVar{
533525
{
534526
Name: settings.EnvHubBaseURL,
535527
Value: Settings.Addon.Hub.URL,
536528
},
537-
{
538-
Name: settings.EnvAddonWorkingDir,
539-
Value: Settings.Addon.Path.WorkingDir,
540-
},
541529
{
542530
Name: settings.EnvTask,
543531
Value: strconv.Itoa(int(r.Task.ID)),
@@ -555,10 +543,6 @@ func (r *Task) container(addon *crd.Addon, secret *core.Secret) (container core.
555543
},
556544
},
557545
VolumeMounts: []core.VolumeMount{
558-
{
559-
Name: "working",
560-
MountPath: Settings.Addon.Path.WorkingDir,
561-
},
562546
{
563547
Name: "cache",
564548
MountPath: Settings.Cache.Path,

0 commit comments

Comments
 (0)