Documentation
¶
Overview ¶
Package validation provides a shared validator instance.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AtLeastOneField ¶
AtLeastOneField checks that at least one exported pointer, slice, or map field in the struct is non-nil, or that at least one non-pointer field is non-zero. Returns an error message and false if all fields are nil/zero (i.e., the update body is empty).
func RegisterTargetValidator ¶
func RegisterTargetValidator( lister AgentLister, )
RegisterTargetValidator registers the valid_target custom validator and sets the AgentLister it uses. Call this at API server startup after the job client is created, or in test SetupSuite to inject a mock.
Types ¶
type AgentLister ¶
type AgentLister func(ctx context.Context) ([]AgentTarget, error)
AgentLister returns active agents with their hostnames and labels.
type AgentTarget ¶
AgentTarget holds the routing-relevant fields of an active agent.