Documentation
¶
Index ¶
- Constants
- func CreateAnsibleJob(policyAutomation *policyv1beta1.PolicyAutomation, ...) error
- func MatchPAGeneration(policyAutomation *policyv1beta1.PolicyAutomation, ...) (bool, error)
- func MatchPAResouceV(policyAutomation *policyv1beta1.PolicyAutomation, ...) (bool, error)
- type PolicyAutomationReconciler
Constants ¶
const ( PolicyAutomationLabel string = "policy.open-cluster-management.io/policyautomation-name" PolicyAutomationGeneration string = "policy.open-cluster-management.io/policyautomation-generation" // policyautomation-ResouceVersion PolicyAutomationResouceV string = "policy.open-cluster-management.io/policyautomation-resource-version" )
const ControllerName string = "policy-automation"
Variables ¶
This section is empty.
Functions ¶
func CreateAnsibleJob ¶ added in v0.13.0
func CreateAnsibleJob(policyAutomation *policyv1beta1.PolicyAutomation, dynamicClient dynamic.Interface, mode string, violationContext policyv1beta1.ViolationContext, ) error
CreateAnsibleJob creates ansiblejob with given PolicyAutomation
func MatchPAGeneration ¶ added in v0.13.0
func MatchPAGeneration(policyAutomation *policyv1beta1.PolicyAutomation, dynamicClient dynamic.Interface, generation int64, ) (bool, error)
Check any ansiblejob is made by input genteration number Returning "true" means the policy automation already created ansiblejob with the generation
func MatchPAResouceV ¶ added in v0.13.0
func MatchPAResouceV(policyAutomation *policyv1beta1.PolicyAutomation, dynamicClient dynamic.Interface, resourceVersion string, ) (bool, error)
Check any ansiblejob is made by current resourceVersion number Returning "true" means the policy automation already created ansiblejob with this resourceVersion
Types ¶
type PolicyAutomationReconciler ¶
type PolicyAutomationReconciler struct { client.Client DynamicClient dynamic.Interface Scheme *runtime.Scheme Recorder record.EventRecorder // contains filtered or unexported fields }
PolicyAutomationReconciler reconciles a PolicyAutomation object
func (*PolicyAutomationReconciler) Reconcile ¶
func (r *PolicyAutomationReconciler) Reconcile( ctx context.Context, request ctrl.Request, ) (ctrl.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 (*PolicyAutomationReconciler) SetupWithManager ¶
func (r *PolicyAutomationReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.