lifecycle

package
v0.10.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package lifecycle provides lifecycle state management for FODC proxy.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentSummary added in v0.10.2

type AgentSummary struct {
	Total        int `json:"total"`
	Requested    int `json:"requested"`
	Responded    int `json:"responded"`
	NotResponded int `json:"not_responded"`
}

AgentSummary describes how many agents the most recent CollectLifecycle invocation saw, requested data from, and actually got data back from. It lets callers tell apart "the cluster has nothing to report" (cluster-side empty) from "the proxy could not reach any agent" (infrastructure-side empty), which look identical when only the InspectionResult is observed.

type InspectionResult

type InspectionResult struct {
	Groups            []*fodcv1.GroupLifecycleInfo `json:"groups"`
	LifecycleStatuses []*PodLifecycleStatus        `json:"lifecycle_statuses"`
}

InspectionResult is the aggregated result from agents and liaison.

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager manages lifecycle data from multiple agents.

func NewManager

func NewManager(registry *registry.AgentRegistry, grpcService RequestSender, log *logger.Logger) *Manager

NewManager creates a new lifecycle manager.

func (*Manager) CollectLifecycle

func (m *Manager) CollectLifecycle(ctx context.Context) (*InspectionResult, AgentSummary)

CollectLifecycle requests and collects lifecycle data from all agents and returns both the aggregated result and the agent summary captured atomically during the same invocation. Returning the summary as a second value (rather than via a separate "LastSummary" accessor) avoids a read-after-write race between the result and the summary when concurrent HTTP requests trigger overlapping collections.

func (*Manager) SetGRPCService

func (m *Manager) SetGRPCService(grpcService RequestSender)

SetGRPCService sets the gRPC service for sending lifecycle data requests.

func (*Manager) UpdateLifecycle

func (m *Manager) UpdateLifecycle(agentID, podName string, data *fodcv1.LifecycleData)

UpdateLifecycle updates lifecycle data for a specific agent.

type PodLifecycleStatus

type PodLifecycleStatus struct {
	PodName string                    `json:"pod_name,omitempty"`
	Reports []*fodcv1.LifecycleReport `json:"reports,omitempty"`
}

PodLifecycleStatus represents lifecycle status for a single pod.

type RequestSender

type RequestSender interface {
	RequestLifecycleData(agentID string) error
}

RequestSender is an interface for sending lifecycle data requests to agents.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL