kubeinteraction

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func AddLabelsAndAnnotations

func AddLabelsAndAnnotations(event *info.Event, pipelineRun *tektonv1.PipelineRun, repo *apipac.Repository, providerConfig *info.ProviderConfig, paramsRun *params.Run) error

func AddResultsAnnotation added in v0.23.0

func AddResultsAnnotation(event *info.Event, pipelineRun *tektonv1.PipelineRun) error

Add annotation to PipelineRuns produced by PaC for capturing additional data specific for TektonResults.

func PollImmediateWithContext

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

Types

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 *tektonv1.PipelineRun, maxKeep int) error

func (Interaction) CreateSecret added in v0.14.3

func (k Interaction) CreateSecret(ctx context.Context, ns string, secret *corev1.Secret) error

func (Interaction) DeleteSecret added in v0.14.3

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

DeleteSecret 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 ktypes.GetSecretOpt) (string, error)

func (Interaction) UpdateSecretWithOwnerRef added in v0.14.3

func (k Interaction) UpdateSecretWithOwnerRef(ctx context.Context, logger *zap.SugaredLogger, targetNamespace, secretName string, pr *pipelinev1.PipelineRun) error

UpdateSecretWithOwnerRef updates the secret with ownerReference.

type Interface

type Interface interface {
	CleanupPipelines(context.Context, *zap.SugaredLogger, *v1alpha1.Repository, *pipelinev1.PipelineRun, int) error
	CreateSecret(ctx context.Context, ns string, secret *corev1.Secret) error
	UpdateSecretWithOwnerRef(context.Context, *zap.SugaredLogger, string, string, *pipelinev1.PipelineRun) error
	GetSecret(context.Context, ktypes.GetSecretOpt) (string, error)
	GetPodLogs(context.Context, string, string, string, int64) (string, error)
}

type ResultAnnotation added in v0.23.0

type ResultAnnotation struct {
	Repo          string `json:"repo"`
	Commit        string `json:"commit"`
	EventType     string `json:"eventType"`
	PullRequestID int    `json:"pull_request-id,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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