storage

package
v0.11.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ArtifactStorageBucketType holds the name of the PipelineResource type for a bucket
	ArtifactStorageBucketType = "bucket"

	// ArtifactStoragePVCType holds the name of the PipelineResource type for a pvc
	ArtifactStoragePVCType = "pvc"
)

Variables

This section is empty.

Functions

func CreateDirStep

func CreateDirStep(shellImage string, name, destinationPath string) v1alpha1.Step

of the step will include name.

func GetPvcMount

func GetPvcMount(name string) corev1.VolumeMount

GetPvcMount returns a mounting of the volume with the mount path /pvc.

Types

type ArtifactBucket

type ArtifactBucket struct {
	Name     string
	Location string
	Secrets  []resource.SecretParam

	ShellImage  string
	GsutilImage string
}

ArtifactBucket contains the Storage bucket configuration defined in the Bucket config map. +k8s:deepcopy-gen=true

func (*ArtifactBucket) DeepCopy

func (in *ArtifactBucket) DeepCopy() *ArtifactBucket

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArtifactBucket.

func (*ArtifactBucket) DeepCopyInto

func (in *ArtifactBucket) DeepCopyInto(out *ArtifactBucket)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ArtifactBucket) GetCopyFromStorageToSteps

func (b *ArtifactBucket) GetCopyFromStorageToSteps(name, sourcePath, destinationPath string) []v1alpha1.Step

GetCopyFromStorageToSteps returns a container used to download artifacts from temporary storage

func (*ArtifactBucket) GetCopyToStorageFromSteps

func (b *ArtifactBucket) GetCopyToStorageFromSteps(name, sourcePath, destinationPath string) []v1alpha1.Step

GetCopyToStorageFromSteps returns a container used to upload artifacts for temporary storage

func (*ArtifactBucket) GetSecretsVolumes

func (b *ArtifactBucket) GetSecretsVolumes() []corev1.Volume

GetSecretsVolumes returns the list of volumes for secrets to be mounted on pod

func (*ArtifactBucket) GetType

func (b *ArtifactBucket) GetType() string

GetType returns the type of the artifact storage

func (*ArtifactBucket) StorageBasePath

func (b *ArtifactBucket) StorageBasePath(pr *v1alpha1.PipelineRun) string

StorageBasePath returns the path to be used to store artifacts in a pipelinerun temporary storage

type ArtifactPVC

type ArtifactPVC struct {
	Name                  string
	PersistentVolumeClaim *corev1.PersistentVolumeClaim

	ShellImage string
}

ArtifactPVC represents the pvc created by the pipelinerun for artifacts temporary storage. +k8s:deepcopy-gen=true

func (*ArtifactPVC) DeepCopy

func (in *ArtifactPVC) DeepCopy() *ArtifactPVC

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArtifactPVC.

func (*ArtifactPVC) DeepCopyInto

func (in *ArtifactPVC) DeepCopyInto(out *ArtifactPVC)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ArtifactPVC) GetCopyFromStorageToSteps

func (p *ArtifactPVC) GetCopyFromStorageToSteps(name, sourcePath, destinationPath string) []v1alpha1.Step

GetCopyFromStorageToSteps returns a container used to download artifacts from temporary storage.

func (*ArtifactPVC) GetCopyToStorageFromSteps

func (p *ArtifactPVC) GetCopyToStorageFromSteps(name, sourcePath, destinationPath string) []v1alpha1.Step

GetCopyToStorageFromSteps returns a container used to upload artifacts for temporary storage.

func (*ArtifactPVC) GetSecretsVolumes

func (p *ArtifactPVC) GetSecretsVolumes() []corev1.Volume

GetSecretsVolumes returns the list of volumes for secrets to be mounted on pod.

func (*ArtifactPVC) GetType

func (p *ArtifactPVC) GetType() string

GetType returns the type of the artifact storage.

func (*ArtifactPVC) StorageBasePath

func (p *ArtifactPVC) StorageBasePath(pr *v1alpha1.PipelineRun) string

StorageBasePath returns the path to be used to store artifacts in a pipelinerun temporary storage.

type BuildGCSResource

type BuildGCSResource struct {
	Name         string
	Type         resource.PipelineResourceType
	Location     string
	ArtifactType GCSArtifactType

	ShellImage           string `json:"-"`
	BuildGCSFetcherImage string `json:"-"`
}

BuildGCSResource describes a resource in the form of an archive, or a source manifest describing files to fetch. BuildGCSResource does incremental uploads for files in directory.

func NewBuildGCSResource

func NewBuildGCSResource(images pipeline.Images, r *resource.PipelineResource) (*BuildGCSResource, error)

NewBuildGCSResource creates a new BuildGCS resource to pass to a Task.

func (*BuildGCSResource) GetInputTaskModifier

func (s *BuildGCSResource) GetInputTaskModifier(ts *v1alpha1.TaskSpec, sourcePath string) (v1alpha1.TaskModifier, error)

GetInputTaskModifier returns a TaskModifier that prepends a step to a Task to fetch the archive or manifest.

func (BuildGCSResource) GetName

func (s BuildGCSResource) GetName() string

GetName returns the name of the resource.

func (*BuildGCSResource) GetOutputTaskModifier

func (s *BuildGCSResource) GetOutputTaskModifier(ts *v1alpha1.TaskSpec, sourcePath string) (v1alpha1.TaskModifier, error)

GetOutputTaskModifier returns a No-op TaskModifier.

func (*BuildGCSResource) GetSecretParams

func (s *BuildGCSResource) GetSecretParams() []resource.SecretParam

GetSecretParams returns nil because it takes no secret params.

func (BuildGCSResource) GetType

GetType returns the type of the resource, in this case "storage".

func (*BuildGCSResource) Replacements

func (s *BuildGCSResource) Replacements() map[string]string

Replacements returns the set of available replacements for this resource.

type GCSArtifactType

type GCSArtifactType string

GCSArtifactType defines a type of GCS resource.

const (
	// GCSZipArchive indicates that the resource should be fetched and
	// extracted as a .zip file.
	//
	// Deprecated: Use GCSZipArchive instead.
	GCSArchive GCSArtifactType = "Archive"

	// GCSZipArchive indicates that the resource should be fetched and
	// extracted as a .zip file.
	GCSZipArchive GCSArtifactType = "ZipArchive"

	// GCSTarGzArchive indicates that the resource should be fetched and
	// extracted as a .tar.gz file.
	GCSTarGzArchive GCSArtifactType = "TarGzArchive"

	// GCSManifest indicates that resource should be fetched using a
	// manifest-based protocol which enables incremental source upload.
	GCSManifest GCSArtifactType = "Manifest"
)

type GCSResource

type GCSResource struct {
	Name     string                                `json:"name"`
	Type     resourcev1alpha1.PipelineResourceType `json:"type"`
	Location string                                `json:"location"`
	TypeDir  bool                                  `json:"typeDir"`
	//Secret holds a struct to indicate a field name and corresponding secret name to populate it
	Secrets []resourcev1alpha1.SecretParam `json:"secrets"`

	ShellImage  string `json:"-"`
	GsutilImage string `json:"-"`
}

GCSResource is a GCS endpoint from which to get artifacts which is required by a Build/Task for context (e.g. a archive from which to build an image).

func NewGCSResource

func NewGCSResource(images pipeline.Images, r *resourcev1alpha1.PipelineResource) (*GCSResource, error)

NewGCSResource creates a new GCS resource to pass to a Task

func (*GCSResource) GetInputTaskModifier

func (s *GCSResource) GetInputTaskModifier(ts *v1alpha1.TaskSpec, path string) (v1alpha1.TaskModifier, error)

GetInputTaskModifier returns the TaskModifier to be used when this resource is an input.

func (GCSResource) GetName

func (s GCSResource) GetName() string

GetName returns the name of the resource

func (*GCSResource) GetOutputTaskModifier

func (s *GCSResource) GetOutputTaskModifier(ts *v1alpha1.TaskSpec, path string) (v1alpha1.TaskModifier, error)

GetOutputTaskModifier returns the TaskModifier to be used when this resource is an output.

func (*GCSResource) GetSecretParams

func (s *GCSResource) GetSecretParams() []resourcev1alpha1.SecretParam

GetSecretParams returns the resource secret params

func (GCSResource) GetType

GetType returns the type of the resource, in this case "storage"

func (*GCSResource) Replacements

func (s *GCSResource) Replacements() map[string]string

Replacements is used for template replacement on an GCSResource inside of a Taskrun.

type PipelineStorageResourceInterface

type PipelineStorageResourceInterface interface {
	v1alpha1.PipelineResourceInterface
	GetSecretParams() []v1alpha1.SecretParam
}

It adds a function to the PipelineResourceInterface for retrieving secrets that are usually needed for storage PipelineResources.

func NewResource

NewResource returns an instance of the requested storage subtype, which can be used to add input and output steps and volumes to an executing pod.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL