grutil

package
v0.10.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthorizeAndAssignDefaults

func AuthorizeAndAssignDefaults(ctx context.Context, c client.Client, gitrepo *fleet.GitRepo) (*fleet.GitRepo, error)

AuthorizeAndAssignDefaults applies restrictions and returns a new GitRepo if it passes the restrictions

func NewRole

func NewRole(namespace string, name string) *rbacv1.Role

func NewRoleBinding

func NewRoleBinding(namespace string, name string) *rbacv1.RoleBinding

func NewServiceAccount

func NewServiceAccount(namespace string, name string) *corev1.ServiceAccount

func NewTargetsConfigMap

func NewTargetsConfigMap(repo *fleet.GitRepo) (*corev1.ConfigMap, error)

NewTargetsConfigMap builds a config map, containing the GitTarget cluster matchers, converted to BundleTargets. The BundleTargets are duplicated into TargetRestrictions. TargetRestrictions is a whilelist. A BundleDeployment will be created for a Target just if it is inside a TargetRestrictions. If it is not inside TargetRestrictions a Target is a TargetCustomization.

func SetCondition

func SetCondition(status *fleet.GitRepoStatus, err error)

SetCondition sets the condition and updates the timestamp, if the condition changed

func SetStatusFromBundleDeployments

func SetStatusFromBundleDeployments(ctx context.Context, c client.Client, gitrepo *fleet.GitRepo) error

func SetStatusFromBundles

func SetStatusFromBundles(ctx context.Context, c client.Client, gitrepo *fleet.GitRepo) error

func SetStatusFromGitjob

func SetStatusFromGitjob(ctx context.Context, c client.Client, gitRepo *fleet.GitRepo, job *batchv1.Job) error

SetStatusFromGitjob sets the status fields relative to the given job in the gitRepo

func SetStatusFromResourceKey

func SetStatusFromResourceKey(ctx context.Context, c client.Client, gitrepo *fleet.GitRepo)

func UpdateDisplayState

func UpdateDisplayState(gitrepo *fleet.GitRepo) error

func UpdateErrorStatus

func UpdateErrorStatus(ctx context.Context, c client.Client, req types.NamespacedName, status fleet.GitRepoStatus, orgErr error) error

UpdateErrorStatus sets the condition in the status and tries to update the resource

func UpdateStatus

func UpdateStatus(ctx context.Context, c client.Client, req types.NamespacedName, status fleet.GitRepoStatus) error

UpdateStatus updates the status for the GitRepo resource. It retries on conflict. If the status was updated successfully, it also collects (as in updates) metrics for the resource GitRepo resource.

Types

This section is empty.

Jump to

Keyboard shortcuts

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