Documentation
¶
Index ¶
- Constants
- Variables
- func GetTerminatedContainersStatusesByPod(pod *corev1.Pod) map[string]*corev1.ContainerStateTerminated
- func IsPodControlledByJobNotFound(err error) bool
- func Reconcile(ctx context.Context, client client.Client, build *buildv1.Build, ...) (_ ctrl.Result, err error)
- type ShellJobController
Constants ¶
View Source
const ( ShellProvisionerRepo = "ghcr.io/forge-build/forge-provisioner-shell" ShellProvisionerTag = "latest" ForgeCoreNamespace = "forge-core" )
Variables ¶
View Source
var HasBuildNameLabel = predicate.NewPredicateFuncs(func(obj client.Object) bool { if _, ok := obj.GetLabels()[buildv1.BuildNameLabel]; ok { return true } return false })
View Source
var HasProvisionerIDLabel = predicate.NewPredicateFuncs(func(obj client.Object) bool { if _, ok := obj.GetLabels()[buildv1.ProvisionerIDLabel]; ok { return true } return false })
View Source
var InNamespace = func(namespace string) predicate.Predicate { return predicate.NewPredicateFuncs(func(obj client.Object) bool { return namespace == obj.GetNamespace() }) }
InNamespace is a predicate.Predicate that returns true if the specified client.Object is in the desired namespace.
View Source
var IsBeingTerminated = predicate.NewPredicateFuncs(func(obj client.Object) bool { return obj.GetDeletionTimestamp() != nil })
IsBeingTerminated is a predicate.Predicate that returns true if the specified client.Object is being terminated, i.e. its DeletionTimestamp property is set to non nil value.
View Source
var JobHasAnyCondition = predicate.NewPredicateFuncs(func(obj client.Object) bool { if job, ok := obj.(*batchv1.Job); ok { return len(job.Status.Conditions) > 0 } return false })
JobHasAnyCondition is a predicate.Predicate that returns true if the specified client.Object is a v1.Job with any v1.JobConditionType.
View Source
var ManagedByForgeProvisionerShell = predicate.NewPredicateFuncs(func(obj client.Object) bool { if managedBy, ok := obj.GetLabels()[buildv1.ManagedByLabel]; ok { return managedBy == shell.ForgeProvisionerShellName } return false })
ManagedByForgeProvisionerShell is a predicate.Predicate that returns true if the specified client.Object is managed by Forge.
Functions ¶
func GetTerminatedContainersStatusesByPod ¶
func GetTerminatedContainersStatusesByPod(pod *corev1.Pod) map[string]*corev1.ContainerStateTerminated
Types ¶
type ShellJobController ¶
type ShellJobController struct {
Logger logr.Logger
client.Client
Clientset *kubernetes.Clientset
Namespace string
// contains filtered or unexported fields
}
ShellJobController watches Kubernetes jobs and reports back to the Build
func (*ShellJobController) GetTerminatedContainersStatusesByJob ¶
func (r *ShellJobController) GetTerminatedContainersStatusesByJob(ctx context.Context, job *batchv1.Job) (map[string]*corev1.ContainerStateTerminated, error)
func (*ShellJobController) SetupWithManager ¶
func (r *ShellJobController) SetupWithManager(mgr ctrl.Manager) error
Click to show internal directories.
Click to hide internal directories.