Documentation
¶
Index ¶
Constants ¶
View Source
const ( StatusKey = "consul.io/endpoint-manager" StatusConditionEndpointsManaged = "EndpointsManaged" StatusReasonSelectorNotFound = "SelectorNotFound" StatusReasonSelectorFound = "SelectorFound" SelectorFoundMessage = "A valid workload selector is present within the service." SelectorNotFoundMessage = "Either the workload selector was not present or contained no selection criteria." )
Variables ¶
View Source
var ( ConditionManaged = &pbresource.Condition{ Type: StatusConditionEndpointsManaged, State: pbresource.Condition_STATE_TRUE, Reason: StatusReasonSelectorFound, Message: SelectorFoundMessage, } ConditionUnmanaged = &pbresource.Condition{ Type: StatusConditionEndpointsManaged, State: pbresource.Condition_STATE_FALSE, Reason: StatusReasonSelectorNotFound, Message: SelectorNotFoundMessage, } )
Functions ¶
func ServiceEndpointsController ¶
func ServiceEndpointsController(workloadMap WorkloadMapper) controller.Controller
ServiceEndpointsController creates a controller to perform automatic endpoint management for services.
Types ¶
type WorkloadMapper ¶
type WorkloadMapper interface {
// MapWorkload conforms to the controller.DependencyMapper signature. Given a Workload
// resource it should report the resource IDs that have selected the workload.
MapWorkload(context.Context, controller.Runtime, *pbresource.Resource) ([]controller.Request, error)
// TrackIDForSelector should be used to associate the specified WorkloadSelector with
// the given resource ID. Future calls to MapWorkload
TrackIDForSelector(*pbresource.ID, *pbcatalog.WorkloadSelector)
// UntrackID should be used to inform the tracker to forget about the specified ID
UntrackID(*pbresource.ID)
}
The WorkloadMapper interface is used to provide an implementation around being able to map a watch even for a Workload resource and translate it to reconciliation requests
Click to show internal directories.
Click to hide internal directories.