Documentation
¶
Index ¶
- Constants
- func BuildHTTPTransport(r *types.RegistryConfig) (*http.Transport, error)
- func CreateOrUpdateSecret(ctx context.Context, cs *kubernetes.Clientset, ns, name string, ...) error
- func DelegateHandler(w http.ResponseWriter, r *http.Request, config *types.ServerConfig, ...)
- func GenerateDockerConfigJSON(r *types.RegistryConfig) ([]byte, error)
- func GetDockerConfig(ctx context.Context, imageRef string, registryConfig *types.RegistryConfig) (name.Reference, []remote.Option, error)
- func ImageExists(ctx context.Context, logger *types.Logger, imageRef string, ...) (bool, error)
- func KanikoJob(ctx context.Context, logger *types.Logger, cs *kubernetes.Clientset, ...) error
- func LookupContainerCommand(checkKubernetes bool) string
- type Container
- type ContainerCommand
- func (c *ContainerCommand) BuildImage(ctx context.Context, imgName ImageName, sourceUrl, containerFile string, ...) error
- func (c *ContainerCommand) ExecTailN(ctx context.Context, command string, args []string, n int) ([]string, error)
- func (c *ContainerCommand) GetContainerLogs(ctx context.Context, name ContainerName) (string, error)
- func (c *ContainerCommand) GetContainerState(ctx context.Context, name ContainerName) (string, bool, error)
- func (c *ContainerCommand) ImageExists(ctx context.Context, name ImageName) (bool, error)
- func (c *ContainerCommand) RemoveContainer(ctx context.Context, name ContainerName) error
- func (c *ContainerCommand) RemoveImage(ctx context.Context, name ImageName) error
- func (c *ContainerCommand) RunContainer(ctx context.Context, appEntry *types.AppEntry, sourceDir string, ...) error
- func (c *ContainerCommand) StartContainer(ctx context.Context, name ContainerName) error
- func (c *ContainerCommand) StopContainer(ctx context.Context, name ContainerName) error
- func (c ContainerCommand) VolumeCreate(ctx context.Context, name VolumeName) error
- func (c ContainerCommand) VolumeExists(ctx context.Context, name VolumeName) bool
- type ContainerManager
- type ContainerName
- type DelegateRequest
- type DevContainerManager
- type ExistsResult
- type ImageName
- type KanikoBuild
- type KubernetesContainerManager
- func (k *KubernetesContainerManager) BuildImage(ctx context.Context, imgName ImageName, sourceUrl, containerFile string, ...) error
- func (k *KubernetesContainerManager) GetContainerLogs(ctx context.Context, name ContainerName) (string, error)
- func (k *KubernetesContainerManager) GetContainerState(ctx context.Context, name ContainerName) (string, bool, error)
- func (k *KubernetesContainerManager) ImageExists(ctx context.Context, name ImageName) (bool, error)
- func (k *KubernetesContainerManager) RunContainer(ctx context.Context, appEntry *types.AppEntry, sourceDir string, ...) error
- func (k *KubernetesContainerManager) StartContainer(ctx context.Context, name ContainerName) error
- func (k *KubernetesContainerManager) StopContainer(ctx context.Context, name ContainerName) error
- func (k *KubernetesContainerManager) VolumeCreate(ctx context.Context, name VolumeName) error
- func (k *KubernetesContainerManager) VolumeExists(ctx context.Context, name VolumeName) bool
- type VolumeInfo
- type VolumeName
Constants ¶
View Source
const ( DOCKER_COMMAND = "docker" PODMAN_COMMAND = "podman" )
View Source
const LABEL_PREFIX = "dev.openrun."
View Source
const UNNAMED_VOLUME = "<UNNAMED>"
Variables ¶
This section is empty.
Functions ¶
func BuildHTTPTransport ¶
func BuildHTTPTransport(r *types.RegistryConfig) (*http.Transport, error)
func CreateOrUpdateSecret ¶
func CreateOrUpdateSecret(ctx context.Context, cs *kubernetes.Clientset, ns, name string, data map[string][]byte, typ corev1.SecretType) error
func DelegateHandler ¶
func DelegateHandler(w http.ResponseWriter, r *http.Request, config *types.ServerConfig, logger *types.Logger)
DelegateHandler is the handler for the delegated build API
func GenerateDockerConfigJSON ¶
func GenerateDockerConfigJSON(r *types.RegistryConfig) ([]byte, error)
func GetDockerConfig ¶
func ImageExists ¶
func KanikoJob ¶
func KanikoJob(ctx context.Context, logger *types.Logger, cs *kubernetes.Clientset, cfg *rest.Config, r *types.RegistryConfig, dockerCfgJSON []byte, kb KanikoBuild) error
func LookupContainerCommand ¶
Types ¶
type ContainerCommand ¶
func NewContainerCommand ¶
func NewContainerCommand(logger *types.Logger, config *types.ServerConfig, appId types.AppId, appRunDir string) *ContainerCommand
func (*ContainerCommand) BuildImage ¶
func (*ContainerCommand) ExecTailN ¶
func (c *ContainerCommand) ExecTailN(ctx context.Context, command string, args []string, n int) ([]string, error)
ExecTailN executes a command and returns the last n lines of output
func (*ContainerCommand) GetContainerLogs ¶
func (c *ContainerCommand) GetContainerLogs(ctx context.Context, name ContainerName) (string, error)
func (*ContainerCommand) GetContainerState ¶
func (c *ContainerCommand) GetContainerState(ctx context.Context, name ContainerName) (string, bool, error)
GetContainerState returns the host:port of the running container, "" if not running. running is true if the container is running.
func (*ContainerCommand) ImageExists ¶
func (*ContainerCommand) RemoveContainer ¶
func (c *ContainerCommand) RemoveContainer(ctx context.Context, name ContainerName) error
func (*ContainerCommand) RemoveImage ¶
func (c *ContainerCommand) RemoveImage(ctx context.Context, name ImageName) error
func (*ContainerCommand) RunContainer ¶
func (*ContainerCommand) StartContainer ¶
func (c *ContainerCommand) StartContainer(ctx context.Context, name ContainerName) error
func (*ContainerCommand) StopContainer ¶
func (c *ContainerCommand) StopContainer(ctx context.Context, name ContainerName) error
func (ContainerCommand) VolumeCreate ¶
func (c ContainerCommand) VolumeCreate(ctx context.Context, name VolumeName) error
func (ContainerCommand) VolumeExists ¶
func (c ContainerCommand) VolumeExists(ctx context.Context, name VolumeName) bool
type ContainerManager ¶
type ContainerManager interface {
BuildImage(ctx context.Context, name ImageName, sourceUrl, containerFile string, containerArgs map[string]string) error
ImageExists(ctx context.Context, name ImageName) (bool, error)
GetContainerState(ctx context.Context, name ContainerName) (string, bool, error)
StartContainer(ctx context.Context, name ContainerName) error
StopContainer(ctx context.Context, name ContainerName) error
RunContainer(ctx context.Context, appEntry *types.AppEntry, sourceDir string, containerName ContainerName,
imageName ImageName, port int64, envMap map[string]string, volumes []*VolumeInfo,
containerOptions map[string]string, paramMap map[string]string) error
GetContainerLogs(ctx context.Context, name ContainerName) (string, error)
VolumeExists(ctx context.Context, name VolumeName) bool
VolumeCreate(ctx context.Context, name VolumeName) error
}
ContainerManager is the interface for managing containers
type ContainerName ¶
type ContainerName string
func GenContainerName ¶
func GenContainerName(appId types.AppId, cm ContainerManager, contentHash string) ContainerName
type DelegateRequest ¶
type DevContainerManager ¶
type DevContainerManager interface {
ContainerManager
RemoveImage(ctx context.Context, name ImageName) error
RemoveContainer(ctx context.Context, name ContainerName) error
}
DevContainerManager is the interface for managing containers in dev mode
type ExistsResult ¶
func CheckImagesExists ¶
func CheckImagesExists(ctx context.Context, logger *types.Logger, imageRef string, registryConfig *types.RegistryConfig) (ExistsResult, error)
type KanikoBuild ¶
type KubernetesContainerManager ¶
func NewKubernetesContainerManager ¶
func NewKubernetesContainerManager(logger *types.Logger, config *types.ServerConfig) (*KubernetesContainerManager, error)
func (*KubernetesContainerManager) BuildImage ¶
func (*KubernetesContainerManager) GetContainerLogs ¶
func (k *KubernetesContainerManager) GetContainerLogs(ctx context.Context, name ContainerName) (string, error)
func (*KubernetesContainerManager) GetContainerState ¶
func (k *KubernetesContainerManager) GetContainerState(ctx context.Context, name ContainerName) (string, bool, error)
func (*KubernetesContainerManager) ImageExists ¶
func (*KubernetesContainerManager) RunContainer ¶
func (*KubernetesContainerManager) StartContainer ¶
func (k *KubernetesContainerManager) StartContainer(ctx context.Context, name ContainerName) error
func (*KubernetesContainerManager) StopContainer ¶
func (k *KubernetesContainerManager) StopContainer(ctx context.Context, name ContainerName) error
func (*KubernetesContainerManager) VolumeCreate ¶
func (k *KubernetesContainerManager) VolumeCreate(ctx context.Context, name VolumeName) error
func (*KubernetesContainerManager) VolumeExists ¶
func (k *KubernetesContainerManager) VolumeExists(ctx context.Context, name VolumeName) bool
type VolumeInfo ¶
type VolumeName ¶
type VolumeName string
func GenVolumeName ¶
func GenVolumeName(appId types.AppId, dirName string) VolumeName
Click to show internal directories.
Click to hide internal directories.