Documentation ¶
Overview ¶
Package builder contains builders for STI and Docker in OpenShift Origin
Index ¶
Constants ¶
const (
OriginalSourceURLAnnotationKey = "openshift.io/original-source-url"
)
Variables ¶
var ( // DefaultPushRetryCount is the number of retries of pushing the built Docker image // into a configured repository DefaultPushRetryCount = 6 // DefaultPushRetryDelay is the time to wait before triggering a push retry DefaultPushRetryDelay = 5 * time.Second // RetriableErrors is a set of strings that indicate that an retriable error occurred. RetriableErrors = []string{ "ping attempt failed with error", "is already in progress", "connection reset by peer", "transport closed before response was received", "connection refused", } )
Functions ¶
func GetCGroupLimits ¶ added in v1.1.2
func GetCGroupLimits() (*s2iapi.CGroupLimits, error)
GetCGroupLimits returns a struct populated with cgroup limit values gathered from the local /sys/fs/cgroup filesystem. Overflow values are set to math.MaxInt64.
Types ¶
type DockerBuilder ¶
type DockerBuilder struct {
// contains filtered or unexported fields
}
DockerBuilder builds Docker images given a git repository URL
func NewDockerBuilder ¶
func NewDockerBuilder(dockerClient DockerClient, buildsClient client.BuildInterface, build *api.Build, gitClient GitClient, cgLimits *s2iapi.CGroupLimits) *DockerBuilder
NewDockerBuilder creates a new instance of DockerBuilder
type DockerClient ¶
type DockerClient interface { BuildImage(opts docker.BuildImageOptions) error PushImage(opts docker.PushImageOptions, auth docker.AuthConfiguration) error RemoveImage(name string) error CreateContainer(opts docker.CreateContainerOptions) (*docker.Container, error) DownloadFromContainer(id string, opts docker.DownloadFromContainerOptions) error PullImage(opts docker.PullImageOptions, auth docker.AuthConfiguration) error RemoveContainer(opts docker.RemoveContainerOptions) error InspectImage(name string) (*docker.Image, error) StartContainer(id string, hostConfig *docker.HostConfig) error WaitContainer(id string) (int, error) Logs(opts docker.LogsOptions) error TagImage(name string, opts docker.TagImageOptions) error }
DockerClient is an interface to the Docker client that contains the methods used by the common builder
type GitClient ¶ added in v1.1.1
type GitClient interface { CloneWithOptions(dir string, url string, args ...string) error Checkout(dir string, ref string) error SubmoduleUpdate(dir string, init, recursive bool) error TimedListRemote(timeout time.Duration, url string, args ...string) (string, string, error) GetInfo(location string) (*git.SourceInfo, []error) }
GitClient performs git operations
type S2IBuilder ¶ added in v1.1.1
type S2IBuilder struct {
// contains filtered or unexported fields
}
S2IBuilder performs an STI build given the build object
func NewS2IBuilder ¶ added in v1.1.1
func NewS2IBuilder(dockerClient DockerClient, dockerSocket string, buildsClient client.BuildInterface, build *api.Build, gitClient GitClient, cgLimits *s2iapi.CGroupLimits) *S2IBuilder
NewS2IBuilder creates a new STIBuilder instance
func (*S2IBuilder) Build ¶ added in v1.1.1
func (s *S2IBuilder) Build() error
Build executes STI build based on configured builder, S2I builder factory and S2I config validator
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package cmd contains the main entry point for the docker and STI builders
|
Package cmd contains the main entry point for the docker and STI builders |
dockercfg
Package dockercfg contains a command helper to read .dockercfg files
|
Package dockercfg contains a command helper to read .dockercfg files |
scmauth
Package scmauth provides SCM authentication methods based on secret files
|
Package scmauth provides SCM authentication methods based on secret files |