Documentation
¶
Overview ¶
Copyright 2023 The Sylva authors
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- func CheckFluxCRDs(ctx context.Context, kubeClient client.Client, retryTimeout time.Duration) error
- func GetChildHelmReleases(obj FluxObject) (hrList []string)
- func NewScheme() *runtime.Scheme
- type FluxAdapter
- type FluxObject
- type Node
- type NodeList
- type NodeVisitor
- type ObjEvent
- type ObjectMap
- type TimeoutInfo
- type TreeInformer
- func (t *TreeInformer) CurrentReconcileDuration(refObj FluxObject, curObj FluxObject) time.Duration
- func (t *TreeInformer) NotifyReconcilableDependents(object FluxObject)
- func (t *TreeInformer) Reconcilable(node Node) bool
- func (t *TreeInformer) ReconcileEnd(curObj FluxObject) time.Time
- func (t *TreeInformer) ReconcileStart(refObj FluxObject) time.Time
- func (t *TreeInformer) Stop()
- func (t *TreeInformer) UpdateObject(fluxObject FluxObject, annotations map[string]string, resume bool)
Constants ¶
const ( DateFormat = "2006-01-02T15:04:05" ReconcileStartedAnnotation = reconcileAnnotationPrefix + "reconcileStartedAt" ReconcileCompletedAnnotation = reconcileAnnotationPrefix + "reconcileCompletedAt" )
const ( UnitReconcileTimeout = "sylvactl/unitTimeout" UnitTimeoutReference = "sylvactl/timeoutReference" )
Variables ¶
This section is empty.
Functions ¶
func CheckFluxCRDs ¶
func GetChildHelmReleases ¶
func GetChildHelmReleases(obj FluxObject) (hrList []string)
Special function to retrieve HelmReleases produced by a Kustomization
Types ¶
type FluxAdapter ¶
type FluxObject ¶
type FluxObject interface {
FluxAdapter
QualifiedName() string
DisplayName() string
GetAnnotationValue(annotationName string) string
HasHandledReconcileAnnotation() bool
HasMissingDependencies() bool
GetMissingDependencies() []string
SetMissingDependencies([]string)
Status() string
Ready() bool
Stalled() bool
// contains filtered or unexported methods
}
func NewFluxObject ¶
func NewFluxObject(obj FluxAdapter, defaultNs string) FluxObject
type Node ¶
type Node interface {
FluxObject
GetObject() FluxObject
Reconciled() bool
Watched() bool
// contains filtered or unexported methods
}
type NodeVisitor ¶
type NodeVisitor struct {
// contains filtered or unexported fields
}
func (*NodeVisitor) Visit ¶
func (nv *NodeVisitor) Visit(v dag.Vertexer)
For any edge a -> b (eg. b depends on a), node a will be visited before node b.
type ObjEvent ¶
type ObjEvent struct {
FluxObject
Delete bool
}
type ObjectMap ¶
type ObjectMap interface {
Store(object FluxObject, updateDeps bool) (FluxObject, Node, bool, error)
Remove(object FluxObject) error
Items() NodeList
Get(qualifiedName string) (Node, bool)
SortedWatchedResources() NodeList
ProcessTopologyChange() error
DependsOn(dependent string, dependency string) bool
GetDependencies(nodeName string) NodeList
GetDependents(nodeName string) NodeList
// contains filtered or unexported methods
}
type TimeoutInfo ¶ added in v0.14.8
type TimeoutInfo struct {
Msg string
FailedResource Node
ReconcileDuration time.Duration
ReconcileStart time.Time
ReconcileEnd time.Time
Timeout time.Duration
TimeoutReferenceUnit string
}
func ComputeTimeoutInfo ¶ added in v0.14.8
func ComputeTimeoutInfo(i *TreeInformer, defaultUnitTimeout time.Duration, timeoutFactor float64, onlyReadyUnits bool) ([]TimeoutInfo, error)
func (*TimeoutInfo) Error ¶ added in v0.14.8
func (e *TimeoutInfo) Error() string
type TreeInformer ¶
type TreeInformer struct {
context.Context
context.CancelFunc
sync.WaitGroup
client.Client
Initialized bool
ReconcileDependents bool
ResumeSuspended bool
ObjectMap
ObjEvents chan ObjEvent
// contains filtered or unexported fields
}
func NewInformer ¶
func (*TreeInformer) CurrentReconcileDuration ¶
func (t *TreeInformer) CurrentReconcileDuration(refObj FluxObject, curObj FluxObject) time.Duration
Returns the duration of current reconcile request, based on reconcile annotations It computes the time elapsed since ReconcileStartedAnnotation of reference object, if it was set with current reconcileID, otherwise it returns 0 If corresponding ReconcileCompletedAnnotation has been set on current object, return the reconcile duration.
func (*TreeInformer) NotifyReconcilableDependents ¶
func (t *TreeInformer) NotifyReconcilableDependents(object FluxObject)
func (*TreeInformer) Reconcilable ¶
func (t *TreeInformer) Reconcilable(node Node) bool
func (*TreeInformer) ReconcileEnd ¶ added in v0.14.8
func (t *TreeInformer) ReconcileEnd(curObj FluxObject) time.Time
ReconcileEnd returns the end time of the current reconcile request for the given object. Returns zero time if the annotation is not set or cannot be parsed.
func (*TreeInformer) ReconcileStart ¶ added in v0.14.8
func (t *TreeInformer) ReconcileStart(refObj FluxObject) time.Time
ReconcileStart returns the start time of the current reconcile request for the given reference object. Returns zero time if the annotation is not set or cannot be parsed.
func (*TreeInformer) Stop ¶
func (t *TreeInformer) Stop()
func (*TreeInformer) UpdateObject ¶
func (t *TreeInformer) UpdateObject(fluxObject FluxObject, annotations map[string]string, resume bool)