Documentation
¶
Index ¶
- type CycleResult
- type FakeKubeclient
- func (f *FakeKubeclient) AdvanceCycle()
- func (f *FakeKubeclient) Clientset() kubernetes.Interface
- func (f *FakeKubeclient) DynamicClient() dynamic.Interface
- func (f *FakeKubeclient) Mapper() meta.RESTMapper
- func (f *FakeKubeclient) MarkDeploymentReady(namespace, name string)
- func (f *FakeKubeclient) Ops() []Op
- func (f *FakeKubeclient) OpsForCycle(cycle int) []Op
- func (f *FakeKubeclient) PatchAnnotations(_ context.Context, obj runtime.Object, _ schema.GroupVersionResource, ...) error
- func (f *FakeKubeclient) PatchFinalizers(_ context.Context, obj runtime.Object, _ schema.GroupVersionResource, ...) error
- func (f *FakeKubeclient) PatchLabels(_ context.Context, obj runtime.Object, _ schema.GroupVersionResource, ...) error
- func (f *FakeKubeclient) PatchStatus(_ context.Context, obj domain.Object, _ schema.GroupVersionResource, ...) error
- type Op
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CycleResult ¶
CycleResult is the output of one reconcile cycle.
type FakeKubeclient ¶
type FakeKubeclient struct {
// contains filtered or unexported fields
}
FakeKubeclient implements kubeclient.KubeClient using k8s fakes. All operations are recorded in Ops() for simulation output.
func NewFakeKubeclient ¶
func NewFakeKubeclient(scheme *runtime.Scheme) *FakeKubeclient
func (*FakeKubeclient) AdvanceCycle ¶
func (f *FakeKubeclient) AdvanceCycle()
AdvanceCycle increments the cycle counter. Call between simulated reconciles.
func (*FakeKubeclient) Clientset ¶
func (f *FakeKubeclient) Clientset() kubernetes.Interface
func (*FakeKubeclient) DynamicClient ¶
func (f *FakeKubeclient) DynamicClient() dynamic.Interface
func (*FakeKubeclient) Mapper ¶
func (f *FakeKubeclient) Mapper() meta.RESTMapper
func (*FakeKubeclient) MarkDeploymentReady ¶
func (f *FakeKubeclient) MarkDeploymentReady(namespace, name string)
MarkDeploymentReady advances simulated state — marks a Deployment as Available. Call after the first reconcile cycle to allow the reconciler to progress through "Deploying" → "Ready" state transitions.
func (*FakeKubeclient) Ops ¶
func (f *FakeKubeclient) Ops() []Op
Ops returns all recorded operations in order.
func (*FakeKubeclient) OpsForCycle ¶
func (f *FakeKubeclient) OpsForCycle(cycle int) []Op
OpsForCycle returns operations from one reconcile cycle.
func (*FakeKubeclient) PatchAnnotations ¶
func (f *FakeKubeclient) PatchAnnotations(_ context.Context, obj runtime.Object, _ schema.GroupVersionResource, annotations map[string]string) error
func (*FakeKubeclient) PatchFinalizers ¶
func (f *FakeKubeclient) PatchFinalizers(_ context.Context, obj runtime.Object, _ schema.GroupVersionResource, finalizers []string) error
func (*FakeKubeclient) PatchLabels ¶
func (f *FakeKubeclient) PatchLabels(_ context.Context, obj runtime.Object, _ schema.GroupVersionResource, _, desired map[string]string) error
func (*FakeKubeclient) PatchStatus ¶
func (f *FakeKubeclient) PatchStatus(_ context.Context, obj domain.Object, _ schema.GroupVersionResource, _ map[string]interface{}) error
type Op ¶
type Op struct {
Cycle int
Verb string // "create", "update", "delete", "get", "patch"
Resource string // "deployments", "services", etc.
Namespace string
Name string
At time.Time
}
Op is one recorded cluster operation.
type Result ¶
type Result struct {
Cycles []CycleResult
Steady bool
SteadyAt int // cycle number where steady state was first detected (0 if not reached)
}
Result is the output of one simulation run.
func Run ¶
func Run(ctx context.Context, kat *katalog.Katalog, crdName string, cr *unstructured.Unstructured, maxCycles int) (*Result, error)
Run simulates the operator against an in-memory cluster.
kat is the parsed Katalog. crdName is the CRD entry to simulate. cr is the CR to reconcile. maxCycles is the maximum number of reconcile cycles.