controller

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BranchProtectionReconciler

type BranchProtectionReconciler struct {
	client.Client
	Scheme                   *runtime.Scheme
	GitHubClient             BranchProtectionRequester
	DeleteOnResourceDeletion bool
	RequeueInterval          time.Duration
}

BranchProtectionReconciler reconciles a BranchProtection object

func (*BranchProtectionReconciler) Reconcile

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 BranchProtection 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.17.0/pkg/reconcile

func (*BranchProtectionReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type BranchProtectionRequester

type BranchProtectionRequester interface {
	RepositoryGetter // needed to create new branch protection rules

	GetBranchProtection(ctx context.Context, nodeId string) (*gh.BranchProtection, error)
	CreateBranchProtection(ctx context.Context, input *githubv4.CreateBranchProtectionRuleInput) (*gh.BranchProtection, error)
	GetBranchProtectionByOwnerRepoPattern(ctx context.Context, repositoryOwner, repositoryName, pattern string) (*gh.BranchProtection, error)
	UpdateBranchProtection(ctx context.Context, input *githubv4.UpdateBranchProtectionRuleInput) (*gh.BranchProtection, error)
	DeleteBranchProtection(ctx context.Context, input *githubv4.DeleteBranchProtectionRuleInput) error
}

type OrganizationReconciler

type OrganizationReconciler struct {
	client.Client
	Scheme                   *runtime.Scheme
	GitHubClient             OrganizationRequester
	DeleteOnResourceDeletion bool
	RequeueInterval          time.Duration
}

OrganizationReconciler reconciles a Organization object

func (*OrganizationReconciler) Reconcile

func (r *OrganizationReconciler) 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 Organization 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.17.0/pkg/reconcile

func (*OrganizationReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type OrganizationRequester

type OrganizationRequester interface {
	GetOrganization(ctx context.Context, org string) (*github.Organization, error)
	GetOrganizationByNodeId(ctx context.Context, nodeId string) (*github.Organization, error)
	UpdateOrganization(ctx context.Context, org string, updateOrg *github.Organization) (*github.Organization, error)
}

type RepositoryGetter

type RepositoryGetter interface {
	GetRepositoryByName(ctx context.Context, owner string, name string) (*github.Repository, error)
	GetRepositoryByNodeId(ctx context.Context, nodeId string) (*github.Repository, error)
}

type RepositoryReconciler

type RepositoryReconciler struct {
	client.Client
	Scheme                   *runtime.Scheme
	GitHubClient             RepositoryRequester
	DeleteOnResourceDeletion bool
	RequeueInterval          time.Duration
}

RepositoryReconciler reconciles a Repository object

func (*RepositoryReconciler) Reconcile

func (r *RepositoryReconciler) 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 Repository 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.17.0/pkg/reconcile

func (*RepositoryReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type RepositoryRequester

type RepositoryRequester interface {
	RepositoryGetter

	UpdateRepositoryByName(ctx context.Context, owner, name string, update *github.Repository) (*github.Repository, error)
	CreateRepository(ctx context.Context, org string, create *github.Repository) (*github.Repository, error)
	CreateRepositoryFromTemplate(ctx context.Context, templateOwner string, templateRepository string, req *github.TemplateRepoRequest) (*github.Repository, error)
	DeleteRepositoryByName(ctx context.Context, owner, name string) error
	UpdateRepositoryTopics(ctx context.Context, owner string, repo string, topics []string) ([]string, error)
}

type TeamReconciler

type TeamReconciler struct {
	client.Client
	Scheme                   *runtime.Scheme
	GitHubClient             TeamRequester
	DeleteOnResourceDeletion bool
	RequeueInterval          time.Duration
}

TeamReconciler reconciles a Team object

func (*TeamReconciler) Reconcile

func (r *TeamReconciler) 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 Team 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.17.0/pkg/reconcile

func (*TeamReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type TeamRequester

type TeamRequester interface {
	GetTeamBySlug(ctx context.Context, org, slug string) (*github.Team, error)
	GetTeamById(ctx context.Context, org, teamId int64) (*github.Team, error)
	GetTeamByNodeId(ctx context.Context, nodeId string) (*github.Team, error)

	CreateTeam(ctx context.Context, org string, newTeam github.NewTeam) (*github.Team, error)
	UpdateTeamBySlug(ctx context.Context, org, slug string, newTeam github.NewTeam) (*github.Team, error)
	UpdateTeamById(ctx context.Context, org, teamId int64, newTeam github.NewTeam) (*github.Team, error)
	DeleteTeamBySlug(ctx context.Context, org, slug string) error
	DeleteTeamById(ctx context.Context, org, teamId int64) error

	GetTeamRepositoryPermission(ctx context.Context, org, slug, repoName string) (*gh.TeamRepositoryPermission, error)
	GetTeamRepositoryPermissions(ctx context.Context, org, slug string) ([]*gh.TeamRepositoryPermission, error)
	UpdateTeamRepositoryPermissions(ctx context.Context, org, slug string, repoName, permission string) error
	RemoveTeamRepositoryPermissions(ctx context.Context, org, slug string, repoName string) error
}

Jump to

Keyboard shortcuts

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