@@ -130,7 +130,7 @@ func (k Kustomize) render(ctx context.Context, kustomizePath string, useKubectlK
130130 defer fs .Cleanup ()
131131
132132 if err := k .mirror (kustomizePath , fs ); err == nil {
133- kustomizePath = filepath .Join (temp , kustomizePath )
133+ kustomizePath = filepath .Join (temp , strings . TrimPrefix ( kustomizePath , filepath . VolumeName ( kustomizePath )) )
134134 } else {
135135 return out , err
136136 }
@@ -167,7 +167,9 @@ func (k Kustomize) mirror(kusDir string, fs TmpFS) error {
167167 return err
168168 }
169169
170- if err := fs .WriteTo (kFile , bytes ); err != nil {
170+ pFile := strings .TrimPrefix (kFile , filepath .VolumeName (kFile ))
171+
172+ if err := fs .WriteTo (pFile , bytes ); err != nil {
171173 return err
172174 }
173175
@@ -314,15 +316,18 @@ func (k Kustomize) mirrorFile(kusDir string, fs TmpFS, path string) error {
314316 if sUtil .IsURL (path ) {
315317 return nil
316318 }
317- pFile := filepath .Join (kusDir , path )
318- bytes , err := os .ReadFile (pFile )
319+
320+ sourceFile := filepath .Join (kusDir , path )
321+ targetFile := strings .TrimPrefix (sourceFile , filepath .VolumeName (sourceFile ))
322+
323+ bytes , err := os .ReadFile (sourceFile )
319324 if err != nil {
320325 return err
321326 }
322- if err := fs .WriteTo (pFile , bytes ); err != nil {
327+ if err := fs .WriteTo (targetFile , bytes ); err != nil {
323328 return err
324329 }
325- fsPath , err := fs .GetPath (pFile )
330+ fsPath , err := fs .GetPath (targetFile )
326331
327332 if err != nil {
328333 return err
@@ -336,7 +341,7 @@ func (k Kustomize) mirrorFile(kusDir string, fs TmpFS, path string) error {
336341
337342 err = k .applySetters .ApplyPath (fsPath )
338343 if err != nil {
339- return fmt .Errorf ("failed to apply setter to file %s, err: %v" , pFile , err )
344+ return fmt .Errorf ("failed to apply setter to file %s, err: %v" , sourceFile , err )
340345 }
341346 }
342347 return nil
0 commit comments