MCPcopy Create free account
hub / github.com/argoproj/argo-workflows / isBaseImagePath

Method isBaseImagePath

workflow/executor/executor.go:585–606  ·  view source on GitHub ↗

isBaseImagePath checks if the given artifact path resides in the base image layer of the container versus a shared volume mount between the wait and main container

(path string)

Source from the content-addressed store, hash-verified

583// isBaseImagePath checks if the given artifact path resides in the base image layer of the container
584// versus a shared volume mount between the wait and main container
585func (we *WorkflowExecutor) isBaseImagePath(path string) bool {
586 // first check if path overlaps with a user-specified volumeMount
587 if common.FindOverlappingVolume(&we.Template, path) != nil {
588 return false
589 }
590 // next check if path overlaps with a shared input-artifact emptyDir mounted by argo
591 for _, inArt := range we.Template.Inputs.Artifacts {
592 if path == inArt.Path {
593 // The input artifact may have been optional and not supplied. If this is the case, the file won't exist on
594 // the input artifact volume. Since this function was called, we know that we want to use this path as an
595 // output artifact, so we should look for it in the base image path.
596 if inArt.Optional && !inArt.HasLocationOrKey() {
597 return true
598 }
599 return false
600 }
601 if strings.HasPrefix(path, inArt.Path+"/") {
602 return false
603 }
604 }
605 return true
606}
607
608// SaveParameters will save the content in the specified file path as output parameter value
609func (we *WorkflowExecutor) SaveParameters(ctx context.Context) error {

Callers 3

TestIsBaseImagePathFunction · 0.95
stageArchiveFileMethod · 0.95
SaveParametersMethod · 0.95

Calls 2

FindOverlappingVolumeFunction · 0.92
HasLocationOrKeyMethod · 0.80

Tested by 1

TestIsBaseImagePathFunction · 0.76