Skip to content

Commit

Permalink
Fix filepath setup
Browse files Browse the repository at this point in the history
With the new mountPath spec, you can assume users specify a full/correct path in harness
  • Loading branch information
michaeljguarino committed May 27, 2024
1 parent 56a697c commit 428ad86
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 3 additions & 1 deletion dockerfiles/harness/base.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,6 @@ COPY --chown=nonroot --from=environment /bin/sh /bin/sh
COPY --chown=nonroot --from=environment /bin/sleep /bin/sleep
COPY --from=builder /plural/harness /harness

ENTRYPOINT ["/harness", "--working-dir=plural"]
WORKDIR /plural

ENTRYPOINT ["/harness", "--working-dir=/plural"]
2 changes: 1 addition & 1 deletion pkg/harness/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func (in *stackRunController) prepare() error {
env := environment.New(
environment.WithStackRun(in.stackRun),
environment.WithWorkingDir(in.dir),
environment.WithFilesDir(in.execWorkDir()),
environment.WithFilesDir(in.dir),
environment.WithFetchClient(in.fetchClient),
)

Expand Down
5 changes: 2 additions & 3 deletions pkg/harness/environment/environment.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package environment

import (
"path"

"k8s.io/klog/v2"

"github.com/pluralsh/deployment-operator/internal/helpers"
Expand Down Expand Up @@ -38,7 +36,8 @@ func (in *environment) prepareFiles() error {
}

for _, fragment := range in.stackRun.Files {
destination := path.Join(in.filesDir, fragment.Path)
// destination := path.Join(in.filesDir, fragment.Path)
destination := fragment.Path
if err := helpers.File().Create(destination, fragment.Content); err != nil {
klog.ErrorS(err, "failed preparing files", "path", destination)
return err
Expand Down

0 comments on commit 428ad86

Please sign in to comment.