controllers

package
v0.0.0-...-50fe416 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComposeRevisionRun

func ComposeRevisionRun(rr RevisionRun) (revisionRun []byte)

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(conn grpc.ClientConnInterface, timeout time.Duration) Client

func (Client) CreateRevisionRun

func (c Client) CreateRevisionRun(ctx context.Context, json io.Reader) error

type ConditionStatus

type ConditionStatus string

ConditionStatus defines RevisionRun condition status.

const (
	TypeAvailable   ConditionStatus = "AVAILABLE"
	TypeProgressing ConditionStatus = "PROGRESSING"
	TypeDegraded    ConditionStatus = "DEGRADED"
)

type PipelineRunTemplate

type PipelineRunTemplate struct {
	Stage      int      `json:"stage"`
	Resolver   []string `json:"resolver"`
	Params     []string `json:"params"`
	ListParams []string `json:"listparams,omitempty"`
	Vclaims    []string `json:"vclaims,omitempty"`
}

func ReadPipelineRunTemplate

func ReadPipelineRunTemplate(crName string, r *RevisionRunReconciler) (bool, PipelineRunTemplate)

type Pipelinerun

type Pipelinerun struct {
	Name                 string  `json:"name"`
	Canfail              bool    `json:"canfail"`
	Stage                float64 `json:"stage"`
	Params               string  `json:"params"`
	ResolverParams       string  `json:"resolverParams"`
	Listparams           string  `json:"listparams"`
	Workspaces           string  `json:"workspaces"`
	VolumeClaimTemplates string  `json:"volumeClaimTemplates"`
}

type Repo

type Repo struct {
	Name         string `json:"name"`
	Branch       string `json:"branch"`
	Organization string `json:"organization"`
}

func ReadRepository

func ReadRepository(crName string, r *RevisionRunReconciler) (bool, Repo)

type RevisionRun

type RevisionRun struct {
	RepoName     string        `json:"repo_name"`
	PushedAt     string        `json:"pushed_at"`
	Author       string        `json:"author"`
	RepoUrl      string        `json:"repo_url"`
	CommitId     string        `json:"commit_id"`
	Pipelineruns []Pipelinerun `json:"pipelineruns"`
}

type RevisionRunReconciler

type RevisionRunReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

RevisionRunReconciler reconciles a RevisionRun object

func (*RevisionRunReconciler) GetRevisionRun

func (r *RevisionRunReconciler) GetRevisionRun(ctx context.Context, req ctrl.Request, revisionRun *stagetimev1beta1.RevisionRun) error

func (*RevisionRunReconciler) Reconcile

func (r *RevisionRunReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the RevisionRun object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.4/pkg/reconcile

func (*RevisionRunReconciler) SetCondition

func (r *RevisionRunReconciler) SetCondition(
	ctx context.Context, req ctrl.Request,
	revisionRun *stagetimev1beta1.RevisionRun, condition ConditionStatus,
	message string,
) error

SetCondition sets the status condition of the RevisionRun.

func (*RevisionRunReconciler) SetInitialCondition

func (r *RevisionRunReconciler) SetInitialCondition(ctx context.Context, req ctrl.Request, RevisionRun *stagetimev1beta1.RevisionRun) error

func (*RevisionRunReconciler) SetupWithManager

func (r *RevisionRunReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

Jump to

Keyboard shortcuts

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