kubeinteraction

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2022 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StateStarted   = "started"
	StateQueued    = "queued"
	StateCompleted = "completed"
)

Variables

This section is empty.

Functions

func AddLabelsAndAnnotations

func AddLabelsAndAnnotations(event *info.Event, pipelineRun *tektonv1beta1.PipelineRun, repo *apipac.Repository, providerinfo *info.ProviderConfig)

func GetBasicAuthSecretName

func GetBasicAuthSecretName() string

func PollImmediateWithContext

func PollImmediateWithContext(ctx context.Context, pollTimeout time.Duration, fn func() (bool, error)) error

Types

type GetSecretOpt

type GetSecretOpt struct {
	Namespace string
	Name      string
	Key       string
}

type Interaction

type Interaction struct {
	Run *params.Run
}

func NewKubernetesInteraction

func NewKubernetesInteraction(c *params.Run) (*Interaction, error)

func (Interaction) CleanupPipelines

func (k Interaction) CleanupPipelines(ctx context.Context, logger *zap.SugaredLogger, repo *v1alpha1.Repository, pr *v1beta1.PipelineRun, maxKeep int) error

func (Interaction) CreateBasicAuthSecret

func (k Interaction) CreateBasicAuthSecret(ctx context.Context, logger *zap.SugaredLogger, runevent *info.Event,
	targetNamespace, secretName string,
) error

CreateBasicAuthSecret Create a secret for git-clone basic-auth workspace

func (Interaction) DeleteBasicAuthSecret

func (k Interaction) DeleteBasicAuthSecret(ctx context.Context, logger *zap.SugaredLogger, targetNamespace, secretName string) error

DeleteBasicAuthSecret deletes the secret created for git-clone basic-auth

func (Interaction) GetEvents added in v0.13.0

func (k Interaction) GetEvents(ctx context.Context, ns, objtype, name string) (*corev1.EventList, error)

func (Interaction) GetPodLogs added in v0.13.0

func (k Interaction) GetPodLogs(ctx context.Context, ns, podName, containerName string, tailLines int64) (string, error)

GetPodLogs of a ns on a podname and container, tailLines is the number of line to tail -1 mean unlimited

func (Interaction) GetSecret

func (k Interaction) GetSecret(ctx context.Context, secretopt GetSecretOpt) (string, error)

type Interface

type Interface interface {
	CleanupPipelines(context.Context, *zap.SugaredLogger, *v1alpha1.Repository, *v1beta1.PipelineRun, int) error
	CreateBasicAuthSecret(context.Context, *zap.SugaredLogger, *info.Event, string, string) error
	DeleteBasicAuthSecret(context.Context, *zap.SugaredLogger, string, string) error
	GetSecret(context.Context, GetSecretOpt) (string, error)
	GetPodLogs(context.Context, string, string, string, int64) (string, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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