info

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPipelinesAscodeSecretName = "pipelines-as-code-secret"

	DefaultPipelinesAscodeConfigmapName = "pipelines-as-code"
	DefaultGlobalRepoName               = "pipelines-as-code"
)

Variables

View Source
var InstallNamespaces = []string{"openshift-pipelines", "pipelines-as-code"}

Functions

func GetCurrentControllerName added in v0.23.0

func GetCurrentControllerName(ctx context.Context) string

GetCurrentControllerName retrieves current controller name from the context.

func GetNS added in v0.23.0

func GetNS(ctx context.Context) string

GetNS gets namespace from context.

func StoreCurrentControllerName added in v0.23.0

func StoreCurrentControllerName(ctx context.Context, name string) context.Context

StoreCurrentControllerName stores current controller name in the context.

func StoreNS added in v0.23.0

func StoreNS(ctx context.Context, ns string) context.Context

StoreNS stores namespace in context.

Types

type ControllerInfo added in v0.23.0

type ControllerInfo struct {
	Name             string `json:"name"`
	Configmap        string `json:"configmap"`
	Secret           string `json:"secret"`
	GlobalRepository string `json:"gRepo"`
}

func GetControllerInfoFromEnvOrDefault added in v0.23.0

func GetControllerInfoFromEnvOrDefault() *ControllerInfo

GetControllerInfoFromEnvOrDefault retrieves controller info from the env or use the defaults TODO: handles doublons when fallbacking in case there is multiple controllers but no env variable.

type Event

type Event struct {
	State
	Event interface{}

	// EventType is what coming from the provider header, i.e:
	// GitHub -> pull_request
	// GitLab -> Merge Request Hook
	// Incoming Webhook  -> incoming (always a push)
	// Usually used for payload filtering passed from trigger directly
	EventType string

	// Full request
	Request *Request

	// TriggerTarget stable field across providers, ie: on Gitlab, Github and
	// others it would be always be pull_request we can rely on to know if it's
	// a push or a pull_request
	TriggerTarget triggertype.Trigger

	// Target PipelineRun, the target PipelineRun user request. Used in incoming webhook
	TargetPipelineRun string

	BaseBranch    string // branch against where we are making the PR
	DefaultBranch string // master/main branches to know where things like the OWNERS file is located.
	HeadBranch    string // branch from where our SHA get tested
	BaseURL       string // url against where we are making the PR
	HeadURL       string // url from where our SHA get tested
	SHA           string
	Sender        string
	URL           string // WEB url not the git URL, which would match to the repo.spec
	SHAURL        string // pretty URL for web browsing for UIs (cli/web)
	SHATitle      string // commit title for UIs

	PullRequestNumber int    // Pull or Merge Request number
	PullRequestTitle  string // Title of the pull Request
	TriggerComment    string // The comment triggering the pipelinerun when using on-comment annotation

	// TODO: move forge specifics to each driver
	// Github
	Organization   string
	Repository     string
	InstallationID int64
	GHEURL         string

	// TODO: move out inside the provider
	// Bitbucket Cloud
	AccountID string

	// TODO: move out inside the provider
	// Bitbucket Server
	CloneURL string // bitbucket server has a different url for cloning the repo than normal public html url
	Provider *Provider

	// Gitlab
	SourceProjectID int
	TargetProjectID int
}

func NewEvent

func NewEvent() *Event

NewEvent returns a new Event.

func (*Event) DeepCopyInto

func (r *Event) DeepCopyInto(out *Event)

DeepCopyInto deep copy runinfo in another instance.

type Info

type Info struct {
	Pac        *PacOpts
	Kube       *KubeOpts
	Controller *ControllerInfo
	// contains filtered or unexported fields
}

func NewInfo added in v0.26.0

func NewInfo() Info

func (*Info) DeepCopy added in v0.23.0

func (i *Info) DeepCopy(out *Info)

func (*Info) GetPacOpts added in v0.26.0

func (i *Info) GetPacOpts() PacOpts

func (*Info) InitInfo added in v0.26.0

func (i *Info) InitInfo()

func (*Info) UpdatePacOpts added in v0.26.0

func (i *Info) UpdatePacOpts(logger *zap.SugaredLogger, configData map[string]string) (*settings.Settings, error)

type KubeOpts

type KubeOpts struct {
	ConfigPath string
	Context    string
	Namespace  string
}

func (*KubeOpts) AddFlags

func (k *KubeOpts) AddFlags(cmd *cobra.Command)

type PacOpts

type PacOpts struct {
	settings.Settings
	WebhookType        string
	PayloadFile        string
	TektonDashboardURL string
}

func NewPacOpts added in v0.26.0

func NewPacOpts() *PacOpts

func (*PacOpts) AddFlags

func (p *PacOpts) AddFlags(cmd *cobra.Command) error

func (*PacOpts) DeepCopy added in v0.23.0

func (p *PacOpts) DeepCopy(out *PacOpts)

type Provider

type Provider struct {
	Token                 string
	URL                   string
	User                  string
	WebhookSecret         string
	WebhookSecretFromRepo bool
}

type ProviderConfig

type ProviderConfig struct {
	TaskStatusTMPL string
	APIURL         string
	Name           string
	SkipEmoji      bool
}

type Request

type Request struct {
	Header  http.Header
	Payload []byte
}

type State

type State struct {
	TargetTestPipelineRun   string
	CancelPipelineRuns      bool
	TargetCancelPipelineRun string
}

Jump to

Keyboard shortcuts

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