Documentation ¶
Index ¶
- Variables
- func CheckForReadiness(myClient client.Client, desiredRuntimeObject runtime.Object) error
- func CreateOrUpdate(ctx context.Context, c client.Client, obj runtime.Object) (controllerutil.OperationResult, error)
- func EnsureRuntimeObject(myClient client.Client, ctx context.Context, log logr.Logger, ...) (ctrl.Result, error)
- func IsJobFinished(job *batchv1.Job) error
- func IsPodReady(pod *corev1.Pod) error
- func IsReplicationControllerReady(rc *corev1.ReplicationController) error
- func IsServiceReady(svc *corev1.Service) error
- func MetaReconcile(req ctrl.Request, mri MetaReconcilerInterface) (ctrl.Result, error)
- func ScheduleResources(myClient client.Client, cr metav1.Object, ...) error
- type MetaReconcilerInterface
- type RuntimeObjectDependency
- type RuntimeObjectDependencyYaml
Constants ¶
This section is empty.
Variables ¶
var (
JobOwnerKey = ".metadata.controller"
)
Functions ¶
func CheckForReadiness ¶
func CreateOrUpdate ¶
func CreateOrUpdate(ctx context.Context, c client.Client, obj runtime.Object) (controllerutil.OperationResult, error)
TODO: Borrowed and modified slightly from https://godoc.org/sigs.k8s.io/controller-runtime/pkg/controller/controllerutil#CreateOrUpdate Changes include removing the mutateFn, using semantic.DeepEqual, doing a deepcopy before create cause create will muck with it
func EnsureRuntimeObject ¶
func IsJobFinished ¶
func IsPodReady ¶
func IsReplicationControllerReady ¶
func IsReplicationControllerReady(rc *corev1.ReplicationController) error
func IsServiceReady ¶
func MetaReconcile ¶
MetaReconcile takes as input a request and an implementer of MetaReconcilerInterface It's to be used inside of a Reconcile loop
func ScheduleResources ¶
func ScheduleResources(myClient client.Client, cr metav1.Object, mapOfUniqueIdToDesiredRuntimeObject map[string]runtime.Object, instructionManual *RuntimeObjectDependencyYaml) error
ScheduleResources takes as input a controller-runtime client, a custom resource, a map of runtime.Object, and a instruction manual It creates a task graph and schedules the runtime objects to the Kubernetes api-server
Types ¶
type MetaReconcilerInterface ¶
type MetaReconcilerInterface interface { // GetClient expects that the implementer returns a "controller-runtime" client GetClient() client.Client // GetCustomResource expects that the implementer returns the custom resource to watch against GetCustomResource(ctrl.Request) (metav1.Object, error) // GetRuntimeObjects expects that the implementer returns a map of uniqueId to runtime.Object to schedule to the api-server GetRuntimeObjects(interface{}) (map[string]runtime.Object, error) // GetInstructionManual expects that the implementer returns a pointer to the instruction manual GetInstructionManual() (*RuntimeObjectDependencyYaml, error) }
MetaReconcilerInterface is a generic interface for running a Reconcile process
type RuntimeObjectDependency ¶
type RuntimeObjectDependency struct { Obj string `yaml:"obj"` IsDependentOn string `yaml:"isdependenton"` }
Dependency Resources from YAML file
type RuntimeObjectDependencyYaml ¶
type RuntimeObjectDependencyYaml struct { Groups map[string][]string `yaml:"runtimeobjectsgroupings"` Dependencies []RuntimeObjectDependency `yaml:"runtimeobjectdependencies"` }