Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
 - func Get[T client.Object](ctx context.Context, cli client.Client, nn types.NamespacedName, obj T) (T, error)
 - func GetLocal[T any, V Resource](r *Request[V], key string) (T, bool)
 - func GetRaw[T any](ctx context.Context, cli client.Client, nn types.NamespacedName, ...) (*T, error)
 - func ReconcileFilter() predicate.Funcs
 - func SetLocal[T any, V Resource](r *Request[V], key string, value T)
 - type Check
 - type ContainerMessage
 - type Reconciler
 - type ReconcilerCtx
 - type Request
 - func (r *Request[T]) AddToOwnedResources(refs ...ResourceRef)
 - func (r *Request[T]) CheckFailed(name string, check Check, msg string) stepResult.Result
 - func (r *Request[T]) CleanupOwnedResources() stepResult.Result
 - func (r *Request[T]) ClearStatusIfAnnotated() stepResult.Result
 - func (r *Request[T]) Context() context.Context
 - func (r *Request[T]) Done(result ...ctrl.Result) stepResult.Result
 - func (r *Request[T]) EnsureChecks(names ...string) stepResult.Result
 - func (r *Request[T]) EnsureFinalizers(finalizers ...string) stepResult.Result
 - func (r *Request[T]) EnsureLabelsAndAnnotations() stepResult.Result
 - func (r *Request[T]) Finalize() stepResult.Result
 - func (r *Request[T]) GetAnchorName() string
 - func (r *Request[T]) GetClient() client.Client
 - func (r *Request[T]) GetOwnedK8sResources() []client.Object
 - func (r *Request[T]) GetOwnedResources() []ResourceRef
 - func (r *Request[T]) LogPostCheck(checkName string)
 - func (r *Request[T]) LogPreCheck(checkName string)
 - func (r *Request[T]) Next() stepResult.Result
 - func (r *Request[T]) PostReconcile()
 - func (r *Request[T]) PreReconcile()
 - func (r *Request[T]) RestartIfAnnotated() stepResult.Result
 - func (r *Request[T]) ShouldReconcile() bool
 - func (r *Request[T]) UpdateStatus() stepResult.Result
 
- type Resource
 - type ResourceRef
 - type State
 - type Status
 
Constants ¶
const ( ErrNotInInputs fstring = "key=%s not found in .Spec.Inputs" ErrNotInGeneratedVars fstring = "key=%s not found in .Status.GeneratedVars" ErrNotInDisplayVars fstring = "key=%s not found in .Status.DisplayVars" ErrNotInReqLocals fstring = "key=%s not found in req.Locals" )
const ( WaitingState string = "yet-to-be-reconciled" RunningState string = "under-reconcilation" ErroredState string = "errored-during-reconcilation" CompletedState string = "finished-reconcilation" )
Variables ¶
This section is empty.
Functions ¶
func GetRaw ¶
func GetRaw[T any](ctx context.Context, cli client.Client, nn types.NamespacedName, obj *unstructured.Unstructured) (*T, error)
func ReconcileFilter ¶
Types ¶
type Check ¶
type Check struct {
	Status bool `json:"status"`
	// State      State  `json:"state"`
	Message    string `json:"message,omitempty"`
	Generation int64  `json:"generation,omitempty"`
}
    +kubebuilder:object:generate=true
func (*Check) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Check.
func (*Check) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ContainerMessage ¶
type ContainerMessage struct {
	State     string `json:"state,omitempty"`
	Pod       string `json:"pod,omitempty"`
	Container string `json:"container,omitempty"`
	Reason    string `json:"reason,omitempty"`
	Message   string `json:"message,omitempty"`
	ExitCode  int32  `json:"exitCode,omitempty"`
}
    func GetMessagesFromPods ¶
func GetMessagesFromPods(pods ...corev1.Pod) []ContainerMessage
type Reconciler ¶
type ReconcilerCtx ¶
func NewReconcilerCtx ¶
func NewReconcilerCtx(parent context.Context, logger logging.Logger) ReconcilerCtx
type Request ¶
type Request[T Resource] struct { Object T Logger logging.Logger // contains filtered or unexported fields }
func NewRequest ¶
func NewRequest[T Resource](ctx ReconcilerCtx, c client.Client, nn types.NamespacedName, resource T) (*Request[T], error)
func (*Request[T]) AddToOwnedResources ¶
func (r *Request[T]) AddToOwnedResources(refs ...ResourceRef)
func (*Request[T]) CheckFailed ¶
func (*Request[T]) CleanupOwnedResources ¶
func (r *Request[T]) CleanupOwnedResources() stepResult.Result
func (*Request[T]) ClearStatusIfAnnotated ¶
func (r *Request[T]) ClearStatusIfAnnotated() stepResult.Result
func (*Request[T]) EnsureChecks ¶
func (r *Request[T]) EnsureChecks(names ...string) stepResult.Result
func (*Request[T]) EnsureFinalizers ¶
func (r *Request[T]) EnsureFinalizers(finalizers ...string) stepResult.Result
func (*Request[T]) EnsureLabelsAndAnnotations ¶
func (r *Request[T]) EnsureLabelsAndAnnotations() stepResult.Result
func (*Request[T]) Finalize ¶
func (r *Request[T]) Finalize() stepResult.Result
func (*Request[T]) GetAnchorName ¶
func (*Request[T]) GetOwnedK8sResources ¶
func (*Request[T]) GetOwnedResources ¶
func (r *Request[T]) GetOwnedResources() []ResourceRef
func (*Request[T]) LogPostCheck ¶
func (*Request[T]) LogPreCheck ¶
func (*Request[T]) Next ¶
func (r *Request[T]) Next() stepResult.Result
func (*Request[T]) PostReconcile ¶
func (r *Request[T]) PostReconcile()
func (*Request[T]) PreReconcile ¶
func (r *Request[T]) PreReconcile()
func (*Request[T]) RestartIfAnnotated ¶
func (r *Request[T]) RestartIfAnnotated() stepResult.Result
func (*Request[T]) ShouldReconcile ¶
func (*Request[T]) UpdateStatus ¶
func (r *Request[T]) UpdateStatus() stepResult.Result
type ResourceRef ¶
type ResourceRef struct {
	metav1.TypeMeta `json:",inline" graphql:"children-required"`
	Namespace       string `json:"namespace"`
	Name            string `json:"name"`
}
    +kubebuilder:object:generate=true
func ParseResourceRef ¶
func ParseResourceRef(obj client.Object) ResourceRef
func (*ResourceRef) DeepCopy ¶
func (in *ResourceRef) DeepCopy() *ResourceRef
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceRef.
func (*ResourceRef) DeepCopyInto ¶
func (in *ResourceRef) DeepCopyInto(out *ResourceRef)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Status ¶
type Status struct {
	// +kubebuilder:validation:Optional
	IsReady   bool             `json:"isReady"`
	Resources []ResourceRef    `json:"resources,omitempty"`
	Message   *rawJson.RawJson `json:"message,omitempty"`
	Checks              map[string]Check `json:"checks,omitempty"`
	LastReadyGeneration int64            `json:"lastReadyGeneration,omitempty"`
	LastReconcileTime   *metav1.Time     `json:"lastReconcileTime,omitempty"`
}
    func (*Status) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Status.
func (*Status) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.