resources

package
v0.0.0-...-7754ea6 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MPL-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FinalizerName                = "finalizers.consul.hashicorp.com"
	ConsulAgentError             = "ConsulAgentError"
	ExternallyManagedConfigError = "ExternallyManagedConfigError"
)
View Source
const (
	// Naming convention: TARGET_REFERENCE.
	GatewayClass_GatewayClassConfigIndex indexName = "__v2_gatewayclass_referencing_gatewayclassconfig"

	APIGateway_GatewayClassIndex  indexName = "__v2_api_gateway_referencing_gatewayclass"
	MeshGateway_GatewayClassIndex indexName = "__v2_mesh_gateway_referencing_gatewayclass"
)

Variables

This section is empty.

Functions

func RegisterGatewayFieldIndexes

func RegisterGatewayFieldIndexes(ctx context.Context, mgr ctrl.Manager) error

RegisterGatewayFieldIndexes registers all of the field indexes for the xGateway controllers. These indexes are similar to indexes used in databases to speed up queries. They allow us to quickly find objects based on a field value.

Types

type APIGatewayController

type APIGatewayController struct {
	client.Client
	Log           logr.Logger
	Scheme        *runtime.Scheme
	Controller    *ConsulResourceController
	GatewayConfig gateways.GatewayConfig
}

APIGatewayController reconciles a APIGateway object.

func (*APIGatewayController) Logger

func (*APIGatewayController) Reconcile

func (r *APIGatewayController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*APIGatewayController) SetupWithManager

func (r *APIGatewayController) SetupWithManager(mgr ctrl.Manager) error

func (*APIGatewayController) UpdateStatus

type ConsulResourceController

type ConsulResourceController struct {
	// ConsulClientConfig is the config for the Consul API client.
	ConsulClientConfig *consul.Config

	// ConsulServerConnMgr is the watcher for the Consul server addresses.
	ConsulServerConnMgr consul.ServerConnectionManager

	common.ConsulTenancyConfig
}

ConsulResourceController is a generic controller that is used to reconcile all Consul Resource types, e.g. TrafficPermissions, ProxyConfiguration, etc., since they share the same reconcile behaviour.

func (*ConsulResourceController) ReconcileResource

func (r *ConsulResourceController) ReconcileResource(ctx context.Context, crdCtrl ResourceController, req ctrl.Request, resource common.ConsulResource) (ctrl.Result, error)

ReconcileResource reconciles an update to a resource. CRD-specific controller's call this function because it handles reconciliation of config entries generically. CRD-specific controller should pass themselves in as updater since we need to call back into their own update methods to ensure they update their internal state.

type ExportedServicesController

type ExportedServicesController struct {
	client.Client
	Log           logr.Logger
	Scheme        *runtime.Scheme
	Controller    *ConsulResourceController
	GatewayConfig gateways.GatewayConfig
}

ExportedServicesController reconciles a MeshGateway object.

func (*ExportedServicesController) Logger

func (*ExportedServicesController) Reconcile

func (*ExportedServicesController) SetupWithManager

func (r *ExportedServicesController) SetupWithManager(mgr ctrl.Manager) error

func (*ExportedServicesController) UpdateStatus

type GRPCRouteController

type GRPCRouteController struct {
	client.Client
	Log        logr.Logger
	Scheme     *runtime.Scheme
	Controller *ConsulResourceController
}

GRPCRouteController reconciles a GRPCRoute object.

func (*GRPCRouteController) Logger

func (*GRPCRouteController) Reconcile

func (r *GRPCRouteController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*GRPCRouteController) SetupWithManager

func (r *GRPCRouteController) SetupWithManager(mgr ctrl.Manager) error

func (*GRPCRouteController) UpdateStatus

type GatewayClassConfigController

type GatewayClassConfigController struct {
	client.Client
	Log        logr.Logger
	Scheme     *runtime.Scheme
	Controller *ConsulResourceController
}

GatewayClassConfigController reconciles a GatewayClassConfig object.

func (*GatewayClassConfigController) Logger

func (*GatewayClassConfigController) Reconcile

func (*GatewayClassConfigController) SetupWithManager

func (r *GatewayClassConfigController) SetupWithManager(mgr ctrl.Manager) error

func (*GatewayClassConfigController) UpdateStatus

type GatewayClassController

type GatewayClassController struct {
	client.Client
	Log        logr.Logger
	Scheme     *runtime.Scheme
	Controller *ConsulResourceController
}

GatewayClassController reconciles a MeshGateway object.

func (*GatewayClassController) Logger

func (*GatewayClassController) Reconcile

func (*GatewayClassController) SetupWithManager

func (r *GatewayClassController) SetupWithManager(mgr ctrl.Manager) error

func (*GatewayClassController) UpdateStatus

type HTTPRouteController

type HTTPRouteController struct {
	client.Client
	Log        logr.Logger
	Scheme     *runtime.Scheme
	Controller *ConsulResourceController
}

HTTPRouteController reconciles a HTTPRoute object.

func (*HTTPRouteController) Logger

func (*HTTPRouteController) Reconcile

func (r *HTTPRouteController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*HTTPRouteController) SetupWithManager

func (r *HTTPRouteController) SetupWithManager(mgr ctrl.Manager) error

func (*HTTPRouteController) UpdateStatus

type MeshConfigurationController

type MeshConfigurationController struct {
	client.Client
	Log        logr.Logger
	Scheme     *runtime.Scheme
	Controller *ConsulResourceController
}

MeshConfigurationController reconciles a MeshConfiguration object.

func (*MeshConfigurationController) Logger

func (*MeshConfigurationController) Reconcile

func (*MeshConfigurationController) SetupWithManager

func (r *MeshConfigurationController) SetupWithManager(mgr ctrl.Manager) error

func (*MeshConfigurationController) UpdateStatus

type MeshGatewayController

type MeshGatewayController struct {
	client.Client
	Log           logr.Logger
	Scheme        *runtime.Scheme
	Controller    *ConsulResourceController
	GatewayConfig gateways.GatewayConfig
}

MeshGatewayController reconciles a MeshGateway object.

func (*MeshGatewayController) Logger

func (*MeshGatewayController) Reconcile

func (r *MeshGatewayController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*MeshGatewayController) SetupWithManager

func (r *MeshGatewayController) SetupWithManager(mgr ctrl.Manager) error

func (*MeshGatewayController) UpdateStatus

type ProxyConfigurationController

type ProxyConfigurationController struct {
	client.Client
	Log        logr.Logger
	Scheme     *runtime.Scheme
	Controller *ConsulResourceController
}

ProxyConfigurationController reconciles a ProxyConfiguration object.

func (*ProxyConfigurationController) Logger

func (*ProxyConfigurationController) Reconcile

func (*ProxyConfigurationController) SetupWithManager

func (r *ProxyConfigurationController) SetupWithManager(mgr ctrl.Manager) error

func (*ProxyConfigurationController) UpdateStatus

type ResourceController

type ResourceController interface {
	// Update updates the state of the whole object.
	Update(context.Context, client.Object, ...client.UpdateOption) error
	// UpdateStatus updates the state of just the object's status.
	UpdateStatus(context.Context, client.Object, ...client.SubResourceUpdateOption) error
	// Get retrieves an object for the given object key from the Kubernetes Cluster.
	// obj must be a struct pointer so that obj can be updated with the response
	// returned by the Server.
	Get(ctx context.Context, key client.ObjectKey, obj client.Object, opts ...client.GetOption) error
	// Logger returns a logger with values added for the specific controller
	// and request name.
	Logger(types.NamespacedName) logr.Logger
}

ResourceController is implemented by resources syncing Consul Resources from their CRD counterparts. It is used by ConsulResourceController to abstract CRD-specific Consul Resources.

type TCPRouteController

type TCPRouteController struct {
	client.Client
	Log        logr.Logger
	Scheme     *runtime.Scheme
	Controller *ConsulResourceController
}

TCPRouteController reconciles a TCPRoute object.

func (*TCPRouteController) Logger

func (*TCPRouteController) Reconcile

func (r *TCPRouteController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*TCPRouteController) SetupWithManager

func (r *TCPRouteController) SetupWithManager(mgr ctrl.Manager) error

func (*TCPRouteController) UpdateStatus

type TrafficPermissionsController

type TrafficPermissionsController struct {
	client.Client
	Log        logr.Logger
	Scheme     *runtime.Scheme
	Controller *ConsulResourceController
}

TrafficPermissionsController reconciles a TrafficPermissions object.

func (*TrafficPermissionsController) Logger

func (*TrafficPermissionsController) Reconcile

func (*TrafficPermissionsController) SetupWithManager

func (r *TrafficPermissionsController) SetupWithManager(mgr ctrl.Manager) error

func (*TrafficPermissionsController) UpdateStatus

Jump to

Keyboard shortcuts

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