Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ require (
github.com/jteeuwen/go-bindata v3.0.8-0.20151023091102-a0ff2567cfb7+incompatible
github.com/opencontainers/go-digest v1.0.0
github.com/opencontainers/image-spec v1.0.2-0.20190823105129-775207bd45b6
github.com/openshift/api v0.0.0-20210603185846-379093ab5d80
github.com/openshift/api v0.0.0-20210624153211-ae79113891b0
github.com/openshift/apiserver-library-go v0.0.0-20210426120049-59b0e972bfb7
github.com/openshift/build-machinery-go v0.0.0-20210423112049-9415d7ebd33e
github.com/openshift/client-go v0.0.0-20210331195552-cf6c2669e01f
Expand Down
8 changes: 8 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+
github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg=
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/coreydaley/api v0.0.0-20210611190050-d0f48cbf0ba3 h1:baI2LyZ7k/5h2GhUUqsbkNb3a/cz1yPa1lebaVugobA=
github.com/coreydaley/api v0.0.0-20210611190050-d0f48cbf0ba3/go.mod h1:izBmoXbUu3z5kUa4FjZhvekTsyzIWiOoaIgJiZBBMQs=
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
Expand Down Expand Up @@ -528,6 +530,12 @@ github.com/openshift/api v0.0.0-20210331162552-3e31249e6a55/go.mod h1:dZ4kytOo3s
github.com/openshift/api v0.0.0-20210331193751-3acddb19d360/go.mod h1:dZ4kytOo3svxJHNYd0J55hwe/6IQG5gAUHUE0F3Jkio=
github.com/openshift/api v0.0.0-20210603185846-379093ab5d80 h1:CSaMNuLE1JbHMLbPilrrEIutoYXdFJFw452s9Jfe+hc=
github.com/openshift/api v0.0.0-20210603185846-379093ab5d80/go.mod h1:izBmoXbUu3z5kUa4FjZhvekTsyzIWiOoaIgJiZBBMQs=
github.com/openshift/api v0.0.0-20210617200138-9f677aa140c1 h1:qwYANvePJZhyBTFPn6kMPqyuPq4Zh8fmgWRtfOPLHgM=
github.com/openshift/api v0.0.0-20210617200138-9f677aa140c1/go.mod h1:izBmoXbUu3z5kUa4FjZhvekTsyzIWiOoaIgJiZBBMQs=
github.com/openshift/api v0.0.0-20210621070332-ea13be50ba2d h1:8+4jIjWRI2FUVq2REmv4XW3bD/Ty2pKIxbC6nGKo4ic=
github.com/openshift/api v0.0.0-20210621070332-ea13be50ba2d/go.mod h1:izBmoXbUu3z5kUa4FjZhvekTsyzIWiOoaIgJiZBBMQs=
github.com/openshift/api v0.0.0-20210624153211-ae79113891b0 h1:Wbo6MbFHqjoPNV5iSONP3VZV50RR6CS8MYoVHFlKIuQ=
github.com/openshift/api v0.0.0-20210624153211-ae79113891b0/go.mod h1:izBmoXbUu3z5kUa4FjZhvekTsyzIWiOoaIgJiZBBMQs=
github.com/openshift/apiserver-library-go v0.0.0-20210426120049-59b0e972bfb7 h1:eJDIx4xV8J+9Zg1W8UJPv5SME0pGNmXttWIUU5Fg6O4=
github.com/openshift/apiserver-library-go v0.0.0-20210426120049-59b0e972bfb7/go.mod h1:nqn2IWld2A+Q9Lp/xGsbmUr2RyDCQixRU83yqAbymUM=
github.com/openshift/build-machinery-go v0.0.0-20210209125900-0da259a2c359/go.mod h1:b1BuldmJlbA/xYtdZvKi+7j5YGB44qJUJDZ9zwiNCfE=
Expand Down
62 changes: 62 additions & 0 deletions pkg/build/apis/build/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,11 @@ type DockerBuildStrategy struct {
// policy. An additional experimental policy 'SkipLayerCacheAndWarn' is the same as
// 'SkipLayerCache' but simply warns if compatibility cannot be preserved.
ImageOptimizationPolicy *ImageOptimizationPolicy

// volumes is a list of input volumes that can be mounted into buildah's runtime environment.
// Only a subset of Kubernetes Volume sources are supported by builds.
// More info: https://kubernetes.io/docs/concepts/storage/volumes
Volumes []BuildVolume
}

// SourceBuildStrategy defines input parameters specific to an Source build.
Expand All @@ -851,6 +856,11 @@ type SourceBuildStrategy struct {

// ForcePull describes if the builder should pull the images from registry prior to building.
ForcePull bool

// volumes is a list of input volumes that can be mounted into buildah's runtime environment.
// Only a subset of Kubernetes Volume sources are supported by builds.
// More info: https://kubernetes.io/docs/concepts/storage/volumes
Volumes []BuildVolume
}

// JenkinsPipelineStrategy holds parameters specific to a Jenkins Pipeline build.
Expand Down Expand Up @@ -1385,3 +1395,55 @@ type SecretSpec struct {
// MountPath is the path at which to mount the secret
MountPath string
}

// BuildVolume describes a volume that is made available to build pods,
// such that it can be mounted into buildah's runtime environment.
// Only a subset of Kubernetes Volume sources are supported.
type BuildVolume struct {
// name is a unique identifier for this BuildVolume
// It must conform to the Kubernetes DNS label standard
// It must be unique within the pod
// It can not collide with volumes that are always added by the build controller.
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
Name string

// source represents the location and type of the mounted volume.
Source BuildVolumeSource

// mounts represents the location and read/write status of the volume
// in the buildah container
Mounts []BuildVolumeMount
}

// BuildVolumeSourceType represents a build volume source type
type BuildVolumeSourceType string

const (
// BuildVolumeSourceTypeSecret is the Secret build source volume type
BuildVolumeSourceTypeSecret BuildVolumeSourceType = "Secret"

// BuildVolumeSourceTypeConfigmap is the ConfigMap build source volume type
BuildVolumeSourceTypeConfigMap BuildVolumeSourceType = "ConfigMap"
)

// BuildVolumeSource represents the source of a volume to mount
// Only one of its supported types may be specified at any given time.
type BuildVolumeSource struct {
// type is the type descriminator for the build volume source
Type BuildVolumeSourceType
// secret represents a Secret that should populate this volume.
// More info: https://kubernetes.io/docs/concepts/storage/volumes#secret
// +optional
Secret *kapi.SecretVolumeSource

// configMap represents a ConfigMap that should populate this volume
// +optional
ConfigMap *kapi.ConfigMapVolumeSource
}

// BuildVolumeMount describes the mounting of a Volume within buildah's runtime environment.
type BuildVolumeMount struct {
// destinationPath is the path within the buildah runtime environment at which the volume should be mounted.
// Must not contain ':' and can not collide with a destination path generated by the builder process.
DestinationPath string
}
178 changes: 178 additions & 0 deletions pkg/build/apis/build/v1/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions pkg/build/apis/build/v1/zz_generated.defaults.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading