source

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GCS

type GCS struct {
	Namespace string
	Bucket    string
	Ctx       context.Context
	// contains filtered or unexported fields
}

GCS represents a google cloud storage build context

func (GCS) Cleanup

func (g GCS) Cleanup()

Cleanup removes the context from the gcs bucket and removes the gcs secret from the cluster

func (GCS) ModifyPod

func (g GCS) ModifyPod(pod *v1.Pod)

ModifyPod adds the gcs secret as a volume to the pod to access the bucket from Kaniko

func (GCS) PrepareCredentials

func (g GCS) PrepareCredentials() error

PrepareCredentials creates a v1.Secret with the contents of the Service Account JSON found at GOOGLE_APPLICATION_CREDENTIALS

func (GCS) RequiresPod

func (GCS) RequiresPod() bool

RequiresPod always returns false as the pod should not be started before the context is uploaded

func (*GCS) UploadTar

func (g *GCS) UploadTar(pod *v1.Pod, tarPath string) error

UploadTar uploads the build context to the specified gcs bucket

type Local

type Local struct {
	Ctx       context.Context
	Namespace string
}

Local represents a local build context which gets uploaded to an init container

func (Local) Cleanup

func (Local) Cleanup()

Cleanup not needed here

func (Local) ModifyPod

func (Local) ModifyPod(pod *v1.Pod)

ModifyPod adds an init container to the pod and an empty volume for the build context

func (Local) PrepareCredentials

func (l Local) PrepareCredentials() error

PrepareCredentials not needed here

func (Local) RequiresPod

func (Local) RequiresPod() bool

RequiresPod returns always true, since the init pod is required to upload the context

func (Local) UploadTar

func (l Local) UploadTar(pod *v1.Pod, tarPath string) error

UploadTar uploads the context tar to the init container

type Source

type Source interface {
	PrepareCredentials() error
	ModifyPod(pod *v1.Pod)
	UploadTar(pod *v1.Pod, tarPath string) error
	Cleanup()
	RequiresPod() bool
}

Source represents a build context source

Jump to

Keyboard shortcuts

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