Documentation ¶
Index ¶
Constants ¶
const (
ControllerName string = "policy-status-sync"
)
Variables ¶
This section is empty.
Functions ¶
func StartComplianceEventsSyncer ¶ added in v0.13.0
func StartComplianceEventsSyncer( ctx context.Context, clusterName string, hubCfg *rest.Config, managedCfg *rest.Config, apiURL string, events workqueue.RateLimitingInterface, ) error
StartComplianceEventsSyncer will monitor the events queue and record compliance events on the compliance events API. It uses either certificate or token authentication to authenticate with the compliance events API using the configuration in hubCfg. Note that apiURL is the base URL to the API. It should not contain the path to the POST API endpoint.
Types ¶
type PolicyReconciler ¶
type PolicyReconciler struct { // This client, initialized using mgr.Client() above, is a split client // that reads objects from the cache and writes to the apiserver HubClient client.Client ManagedClient client.Client HubRecorder record.EventRecorder ManagedRecorder record.EventRecorder Scheme *runtime.Scheme ClusterNamespaceOnHub string ConcurrentReconciles int // EventsQueue is a queue that accepts ComplianceAPIEventRequest to then be recorded in the compliance events // API by StartComplianceEventsSyncer. If the compliance events API is disabled, this will be nil. EventsQueue workqueue.RateLimitingInterface }
ReconcilePolicy reconciles a Policy object
func (*PolicyReconciler) Reconcile ¶
func (r *PolicyReconciler) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error)
Reconcile reads that state of the cluster for a Policy object and makes changes based on the state read and what is in the Policy.Spec Note: The Controller will requeue the Request to be processed again if the returned error is non-nil or Result.Requeue is true, otherwise upon completion it will remove the work from the queue.
func (*PolicyReconciler) SetupWithManager ¶
func (r *PolicyReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.