Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrDeleteNotSupported = errors.New("delete not supported for this artifact storage, please check" +
" the following issue for details: https://github.com/argoproj/argo-workflows/issues/3102")
ErrDeleteNotSupported Sentinel error definition for artifact deletion
Functions ¶
func LoadToStream ¶
func LoadToStream(ctx context.Context, a *wfv1.Artifact, g ArtifactDriver) (io.ReadCloser, error)
Use ArtifactDriver.Load() to get a stream, which we can use for all implementations of ArtifactDriver.OpenStream() that aren't yet implemented the "right way" and/or for those that don't have a natural way of streaming
func LocalPathForObject ¶ added in v4.0.12
LocalPathForObject returns the path under dest at which an object stored under keyPrefix should be written, or an error if the key would place the file outside dest.
Object keys come from the storage backend and are untrusted: a key containing ".." segments, or one that lands under a symlink already present inside dest, must not be able to write outside dest. This mirrors the containment checks applied to archive entries by untar. Object keys always use "/" as their separator.
Types ¶
type ArtifactDriver ¶
type ArtifactDriver interface {
// Load accepts an artifact source URL and places it at specified path
Load(ctx context.Context, inputArtifact *v1alpha1.Artifact, path string) error
// OpenStream opens an artifact for reading. If the artifact is a file,
// then the file should be opened. If the artifact is a directory, the
// driver may return that as a tarball. OpenStream is intended to be efficient,
// so implementations should minimise usage of disk, CPU and memory.
// Implementations must not implement retry mechanisms. This will be handled by
// the client, so would result in O(nm) cost.
OpenStream(ctx context.Context, a *v1alpha1.Artifact) (io.ReadCloser, error)
// Save uploads the path to artifact destination
Save(ctx context.Context, path string, outputArtifact *v1alpha1.Artifact) error
Delete(ctx context.Context, artifact *v1alpha1.Artifact) error
ListObjects(ctx context.Context, artifact *v1alpha1.Artifact) ([]string, error)
IsDirectory(ctx context.Context, artifact *v1alpha1.Artifact) (bool, error)
}
ArtifactDriver is the interface for loading and saving of artifacts