Documentation ¶
Index ¶
- Constants
- func CleanupArtifactStorage(pr *v1beta1.PipelineRun, c kubernetes.Interface, logger *zap.SugaredLogger) error
- func ConfigMapNeedsPVC(configMap *corev1.ConfigMap, err error, logger *zap.SugaredLogger) (bool, error)
- func GetBucketConfigName() string
- func GetPVCConfigName() string
- func GetPVCName(n named) string
- func GetPVCSpec(pr *v1beta1.PipelineRun, pvcSize resource.Quantity, storageClassName *string) *corev1.PersistentVolumeClaim
- func NewArtifactBucketConfigFromConfigMap(images pipeline.Images) func(configMap *corev1.ConfigMap) (*storage.ArtifactBucket, error)
- type ArtifactStorageInterface
- type ArtifactStorageNone
- func (a *ArtifactStorageNone) GetCopyFromStorageToSteps(name, sourcePath, destinationPath string) []v1beta1.Step
- func (a *ArtifactStorageNone) GetCopyToStorageFromSteps(name, sourcePath, destinationPath string) []v1beta1.Step
- func (a *ArtifactStorageNone) GetSecretsVolumes() []corev1.Volume
- func (a *ArtifactStorageNone) GetType() string
- func (a *ArtifactStorageNone) StorageBasePath(pr *v1beta1.PipelineRun) string
Constants ¶
const ( // PVCSizeKey is the name of the configmap entry that specifies the size of the PVC to create PVCSizeKey = "size" // DefaultPVCSize is the default size of the PVC to create DefaultPVCSize = "5Gi" // PVCStorageClassNameKey is the name of the configmap entry that specifies the storage class of the PVC to create PVCStorageClassNameKey = "storageClassName" // BucketLocationKey is the name of the configmap entry that specifies // loction of the bucket. BucketLocationKey = "location" // BucketServiceAccountSecretName is the name of the configmap entry that specifies // the name of the secret that will provide the servie account with bucket access. // This secret must have a key called serviceaccount that will have a value with // the service account with access to the bucket BucketServiceAccountSecretName = "bucket.service.account.secret.name" // BucketServiceAccountSecretKey is the name of the configmap entry that specifies // the secret key that will have a value with the service account json with access // to the bucket BucketServiceAccountSecretKey = "bucket.service.account.secret.key" // BucketServiceAccountFieldName is the name of the configmap entry that specifies // the field name that should be used for the service account. // Valid values: GOOGLE_APPLICATION_CREDENTIALS, BOTO_CONFIG. Defaults to GOOGLE_APPLICATION_CREDENTIALS. BucketServiceAccountFieldName = "bucket.service.account.field.name" )
Variables ¶
This section is empty.
Functions ¶
func CleanupArtifactStorage ¶ added in v0.4.0
func CleanupArtifactStorage(pr *v1beta1.PipelineRun, c kubernetes.Interface, logger *zap.SugaredLogger) error
CleanupArtifactStorage will delete the PipelineRun's artifact storage PVC if it exists. The PVC is created for using an output workspace or artifacts from one Task to another Task. No other PVCs will be impacted by this cleanup.
func ConfigMapNeedsPVC ¶ added in v0.5.0
func ConfigMapNeedsPVC(configMap *corev1.ConfigMap, err error, logger *zap.SugaredLogger) (bool, error)
ConfigMapNeedsPVC checks if the possibly-nil config map passed to it is configured to use a bucket for artifact storage, returning true if instead a PVC is needed.
func GetBucketConfigName ¶ added in v0.10.0
func GetBucketConfigName() string
GetBucketConfigName returns the name of the configmap containing all customizations for the storage bucket.
func GetPVCConfigName ¶ added in v0.10.0
func GetPVCConfigName() string
GetPVCConfigName returns the name of the configmap containing all customizations for the storage PVC.
func GetPVCName ¶ added in v0.4.0
func GetPVCName(n named) string
GetPVCName returns the name that should be used for the PVC for a PipelineRun
func GetPVCSpec ¶ added in v0.4.0
func GetPVCSpec(pr *v1beta1.PipelineRun, pvcSize resource.Quantity, storageClassName *string) *corev1.PersistentVolumeClaim
GetPVCSpec returns the PVC to create for a given PipelineRun
func NewArtifactBucketConfigFromConfigMap ¶
func NewArtifactBucketConfigFromConfigMap(images pipeline.Images) func(configMap *corev1.ConfigMap) (*storage.ArtifactBucket, error)
NewArtifactBucketConfigFromConfigMap creates a Bucket from the supplied ConfigMap
Types ¶
type ArtifactStorageInterface ¶
type ArtifactStorageInterface interface { GetCopyToStorageFromSteps(name, sourcePath, destinationPath string) []v1beta1.Step GetCopyFromStorageToSteps(name, sourcePath, destinationPath string) []v1beta1.Step GetSecretsVolumes() []corev1.Volume GetType() string StorageBasePath(pr *v1beta1.PipelineRun) string }
ArtifactStorageInterface is an interface to define the steps to copy an pipeline artifact to/from temporary storage
func GetArtifactStorage ¶
func GetArtifactStorage(images pipeline.Images, prName string, c kubernetes.Interface, logger *zap.SugaredLogger) (ArtifactStorageInterface, error)
GetArtifactStorage returns the storage interface to enable consumer code to get a container step for copy to/from storage
func InitializeArtifactStorage ¶
func InitializeArtifactStorage(images pipeline.Images, pr *v1beta1.PipelineRun, ps *v1beta1.PipelineSpec, c kubernetes.Interface, logger *zap.SugaredLogger) (ArtifactStorageInterface, error)
InitializeArtifactStorage will check if there is there is a bucket configured, create a PVC or return nil if no storage is required.
type ArtifactStorageNone ¶ added in v0.5.0
type ArtifactStorageNone struct{}
ArtifactStorageNone is used when no storage is needed.
func (*ArtifactStorageNone) GetCopyFromStorageToSteps ¶ added in v0.9.0
func (a *ArtifactStorageNone) GetCopyFromStorageToSteps(name, sourcePath, destinationPath string) []v1beta1.Step
GetCopyFromStorageToSteps returns no containers because none are needed.
func (*ArtifactStorageNone) GetCopyToStorageFromSteps ¶ added in v0.9.0
func (a *ArtifactStorageNone) GetCopyToStorageFromSteps(name, sourcePath, destinationPath string) []v1beta1.Step
GetCopyToStorageFromSteps returns no containers because none are needed.
func (*ArtifactStorageNone) GetSecretsVolumes ¶ added in v0.5.0
func (a *ArtifactStorageNone) GetSecretsVolumes() []corev1.Volume
GetSecretsVolumes returns no volumes because none are needed.
func (*ArtifactStorageNone) GetType ¶ added in v0.5.0
func (a *ArtifactStorageNone) GetType() string
GetType returns the string "none" to indicate this is the None storage type.
func (*ArtifactStorageNone) StorageBasePath ¶ added in v0.5.0
func (a *ArtifactStorageNone) StorageBasePath(pr *v1beta1.PipelineRun) string
StorageBasePath returns an empty string because no storage is being used and so there is no path that resources should be copied from / to.