Documentation ¶
Overview ¶
Package v1beta1 contains API Schema definitions for the policy v1beta1 API group +kubebuilder:object:generate=true +groupName=policy.open-cluster-management.io
Index ¶
- Constants
- Variables
- type AutomationDef
- type ClusterEvent
- type NonEmptyString
- type PolicyAutomation
- type PolicyAutomationList
- type PolicyAutomationMode
- type PolicyAutomationSpec
- type PolicyAutomationStatus
- type PolicySet
- type PolicySetList
- type PolicySetSpec
- type PolicySetStatus
- type PolicySetStatusPlacement
- type ReplicatedComplianceHistory
- type ReplicatedDetailsPerTemplate
- type ReplicatedPolicyStatus
- type ViolationContext
Constants ¶
const DefaultPolicyViolationsLimit = 1000
Variables ¶
var ( // GroupVersion is group version used to register these objects GroupVersion = schema.GroupVersion{Group: "policy.open-cluster-management.io", Version: "v1beta1"} // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme )
Functions ¶
This section is empty.
Types ¶
type AutomationDef ¶
type AutomationDef struct { // Type of the automation to invoke Type string `json:"type,omitempty"` // Name of the Ansible Template to run in Tower as a job // +kubebuilder:validation:Required // +kubebuilder:validation:MinLength=1 Name string `json:"name"` // ExtraVars is passed to the Ansible job at execution time and is a known Ansible entity. // +kubebuilder:pruning:PreserveUnknownFields ExtraVars *runtime.RawExtension `json:"extra_vars,omitempty"` // TowerSecret is the name of the secret that contains the Ansible Automation Platform // credential. // +kubebuilder:validation:Required // +kubebuilder:validation:MinLength=1 TowerSecret string `json:"secret"` // JobTTL sets the time to live for the Kubernetes AnsibleJob object after the Ansible job run has finished. JobTTL *int `json:"jobTtl,omitempty"` // +kubebuilder:validation:Minimum=0 // The maximum number of violating cluster contexts that will be provided to the Ansible job as extra variables. // When policyViolationsLimit is set to 0, it means no limit. // The default value is 1000. PolicyViolationsLimit *uint `json:"policyViolationsLimit,omitempty"` }
AutomationDef defines the automation to invoke
func (*AutomationDef) DeepCopy ¶
func (in *AutomationDef) DeepCopy() *AutomationDef
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutomationDef.
func (*AutomationDef) DeepCopyInto ¶
func (in *AutomationDef) DeepCopyInto(out *AutomationDef)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ClusterEvent ¶ added in v0.9.0
type ClusterEvent struct { // Policy automation start time for everyEvent mode AutomationStartTime string `json:"automationStartTime"` // The last policy compliance transition event time EventTime string `json:"eventTime"` }
PolicyAutomation events on each target cluster
func (*ClusterEvent) DeepCopy ¶ added in v0.10.0
func (in *ClusterEvent) DeepCopy() *ClusterEvent
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterEvent.
func (*ClusterEvent) DeepCopyInto ¶ added in v0.10.0
func (in *ClusterEvent) DeepCopyInto(out *ClusterEvent)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type NonEmptyString ¶ added in v0.7.0
type NonEmptyString string
+kubebuilder:validation:MinLength=1
type PolicyAutomation ¶
type PolicyAutomation struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` // +kubebuilder:validation:Required Spec PolicyAutomationSpec `json:"spec"` Status PolicyAutomationStatus `json:"status,omitempty"` }
PolicyAutomation is the Schema for the policyautomations API +kubebuilder:subresource:status +kubebuilder:resource:path=policyautomations,scope=Namespaced +kubebuilder:resource:path=policyautomations,shortName=plca
func (*PolicyAutomation) DeepCopy ¶
func (in *PolicyAutomation) DeepCopy() *PolicyAutomation
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyAutomation.
func (*PolicyAutomation) DeepCopyInto ¶
func (in *PolicyAutomation) DeepCopyInto(out *PolicyAutomation)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*PolicyAutomation) DeepCopyObject ¶
func (in *PolicyAutomation) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type PolicyAutomationList ¶
type PolicyAutomationList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []PolicyAutomation `json:"items"` }
PolicyAutomationList contains a list of PolicyAutomation
func (*PolicyAutomationList) DeepCopy ¶
func (in *PolicyAutomationList) DeepCopy() *PolicyAutomationList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyAutomationList.
func (*PolicyAutomationList) DeepCopyInto ¶
func (in *PolicyAutomationList) DeepCopyInto(out *PolicyAutomationList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*PolicyAutomationList) DeepCopyObject ¶
func (in *PolicyAutomationList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type PolicyAutomationMode ¶ added in v0.9.0
type PolicyAutomationMode string
+kubebuilder:validation:Enum={once,everyEvent,disabled} +kubebuilder:validation:Required
const ( Once PolicyAutomationMode = "once" EveryEvent PolicyAutomationMode = "everyEvent" Disabled PolicyAutomationMode = "disabled" )
type PolicyAutomationSpec ¶
type PolicyAutomationSpec struct { // PolicyRef is the name of the policy that this automation resource // is bound to. // +kubebuilder:validation:Required PolicyRef string `json:"policyRef"` // Mode decides how automation is going to be triggered Mode PolicyAutomationMode `json:"mode"` // EventHook decides when automation is going to be triggered // +kubebuilder:validation:Enum={noncompliant} // +kubebuilder:validation:Required EventHook string `json:"eventHook,omitempty"` // RescanAfter is reserved for future use. RescanAfter string `json:"rescanAfter,omitempty"` // DelayAfterRunSeconds sets the minimum number of seconds before // an automation can run again due to a new violation on the same // managed cluster. This only applies to the EveryEvent Mode. The // default value is 0. // +kubebuilder:validation:Minimum=0 DelayAfterRunSeconds uint `json:"delayAfterRunSeconds,omitempty"` // +kubebuilder:validation:Required Automation AutomationDef `json:"automationDef"` }
PolicyAutomationSpec defines the desired state of PolicyAutomation
func (*PolicyAutomationSpec) DeepCopy ¶
func (in *PolicyAutomationSpec) DeepCopy() *PolicyAutomationSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyAutomationSpec.
func (*PolicyAutomationSpec) DeepCopyInto ¶
func (in *PolicyAutomationSpec) DeepCopyInto(out *PolicyAutomationSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PolicyAutomationStatus ¶
type PolicyAutomationStatus struct { // Cluster name as the key of ClustersWithEvent ClustersWithEvent map[string]ClusterEvent `json:"clustersWithEvent,omitempty"` }
PolicyAutomationStatus defines the observed state of PolicyAutomation
func (*PolicyAutomationStatus) DeepCopy ¶
func (in *PolicyAutomationStatus) DeepCopy() *PolicyAutomationStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyAutomationStatus.
func (*PolicyAutomationStatus) DeepCopyInto ¶
func (in *PolicyAutomationStatus) DeepCopyInto(out *PolicyAutomationStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PolicySet ¶ added in v0.7.0
type PolicySet struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` // +kubebuilder:validation:Required Spec PolicySetSpec `json:"spec"` Status PolicySetStatus `json:"status,omitempty"` }
+kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:resource:path=policysets,scope=Namespaced +kubebuilder:resource:path=policysets,shortName=plcset +kubebuilder:printcolumn:name="Compliance state",type="string",JSONPath=".status.compliant" +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" PolicySet is the Schema for the policysets API
func (*PolicySet) DeepCopy ¶ added in v0.7.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicySet.
func (*PolicySet) DeepCopyInto ¶ added in v0.7.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*PolicySet) DeepCopyObject ¶ added in v0.7.0
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type PolicySetList ¶ added in v0.7.0
type PolicySetList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []PolicySet `json:"items"` }
PolicySetList contains a list of PolicySet
func (*PolicySetList) DeepCopy ¶ added in v0.7.0
func (in *PolicySetList) DeepCopy() *PolicySetList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicySetList.
func (*PolicySetList) DeepCopyInto ¶ added in v0.7.0
func (in *PolicySetList) DeepCopyInto(out *PolicySetList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*PolicySetList) DeepCopyObject ¶ added in v0.7.0
func (in *PolicySetList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type PolicySetSpec ¶ added in v0.7.0
type PolicySetSpec struct { // Description of this PolicySet. Description string `json:"description,omitempty"` // Policies that are grouped together within the PolicySet. // +kubebuilder:validation:Required Policies []NonEmptyString `json:"policies"` }
PolicySetSpec describes a group of policies that are related and can be placed on the same managed clusters.
func (*PolicySetSpec) DeepCopy ¶ added in v0.7.0
func (in *PolicySetSpec) DeepCopy() *PolicySetSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicySetSpec.
func (*PolicySetSpec) DeepCopyInto ¶ added in v0.7.0
func (in *PolicySetSpec) DeepCopyInto(out *PolicySetSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PolicySetStatus ¶ added in v0.7.0
type PolicySetStatus struct { Placement []PolicySetStatusPlacement `json:"placement,omitempty"` Compliant string `json:"compliant,omitempty"` StatusMessage string `json:"statusMessage,omitempty"` }
PolicySetStatus defines the observed state of PolicySet
func (*PolicySetStatus) DeepCopy ¶ added in v0.7.0
func (in *PolicySetStatus) DeepCopy() *PolicySetStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicySetStatus.
func (*PolicySetStatus) DeepCopyInto ¶ added in v0.7.0
func (in *PolicySetStatus) DeepCopyInto(out *PolicySetStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PolicySetStatusPlacement ¶ added in v0.7.0
type PolicySetStatusPlacement struct { PlacementBinding string `json:"placementBinding,omitempty"` Placement string `json:"placement,omitempty"` PlacementRule string `json:"placementRule,omitempty"` }
PolicySetStatusPlacement defines a placement object for the status
func (*PolicySetStatusPlacement) DeepCopy ¶ added in v0.7.0
func (in *PolicySetStatusPlacement) DeepCopy() *PolicySetStatusPlacement
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicySetStatusPlacement.
func (*PolicySetStatusPlacement) DeepCopyInto ¶ added in v0.7.0
func (in *PolicySetStatusPlacement) DeepCopyInto(out *PolicySetStatusPlacement)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ReplicatedComplianceHistory ¶ added in v0.10.0
type ReplicatedComplianceHistory struct { LastTimestamp metav1.Time `json:"lastTimestamp,omitempty" protobuf:"bytes,7,opt,name=lastTimestamp"` Message string `json:"message,omitempty" protobuf:"bytes,4,opt,name=message"` }
ReplicatedComplianceHistory defines the replicated policy compliance details history
func (*ReplicatedComplianceHistory) DeepCopy ¶ added in v0.12.0
func (in *ReplicatedComplianceHistory) DeepCopy() *ReplicatedComplianceHistory
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicatedComplianceHistory.
func (*ReplicatedComplianceHistory) DeepCopyInto ¶ added in v0.12.0
func (in *ReplicatedComplianceHistory) DeepCopyInto(out *ReplicatedComplianceHistory)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ReplicatedDetailsPerTemplate ¶ added in v0.10.0
type ReplicatedDetailsPerTemplate struct { ComplianceState policyv1.ComplianceState `json:"compliant"` History []ReplicatedComplianceHistory `json:"history"` }
ReplicatedDetailsPerTemplate defines the replicated policy compliance details and history
func (*ReplicatedDetailsPerTemplate) DeepCopy ¶ added in v0.12.0
func (in *ReplicatedDetailsPerTemplate) DeepCopy() *ReplicatedDetailsPerTemplate
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicatedDetailsPerTemplate.
func (*ReplicatedDetailsPerTemplate) DeepCopyInto ¶ added in v0.12.0
func (in *ReplicatedDetailsPerTemplate) DeepCopyInto(out *ReplicatedDetailsPerTemplate)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ReplicatedPolicyStatus ¶ added in v0.10.0
type ReplicatedPolicyStatus struct { ComplianceState policyv1.ComplianceState `json:"compliant"` // used by replicated policy ViolationMessage string `json:"violation_message"` // used by replicated policy Details []ReplicatedDetailsPerTemplate `json:"details"` // used by replicated policy }
ReplicatedPolicyStatus defines the replicated policy status
func (*ReplicatedPolicyStatus) DeepCopy ¶ added in v0.12.0
func (in *ReplicatedPolicyStatus) DeepCopy() *ReplicatedPolicyStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicatedPolicyStatus.
func (*ReplicatedPolicyStatus) DeepCopyInto ¶ added in v0.12.0
func (in *ReplicatedPolicyStatus) DeepCopyInto(out *ReplicatedPolicyStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ViolationContext ¶ added in v0.10.0
type ViolationContext struct { TargetClusters []string `json:"targetClusters" ansibleJob:"target_clusters"` PolicyName string `json:"policyName" ansibleJob:"policy_name"` PolicyNamespace string `json:"policyNamespace" ansibleJob:"policy_namespace"` HubCluster string `json:"hubCluster" ansibleJob:"hub_cluster"` PolicySets []string `json:"policySets" ansibleJob:"policy_sets"` PolicyViolations map[string]ReplicatedPolicyStatus `json:"policyViolations" ansibleJob:"policy_violations"` }
ViolationContext defines the non-compliant replicated policy information that is sent to the AnsibleJob through extra_vars.
func (*ViolationContext) DeepCopy ¶ added in v0.12.0
func (in *ViolationContext) DeepCopy() *ViolationContext
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ViolationContext.
func (*ViolationContext) DeepCopyInto ¶ added in v0.12.0
func (in *ViolationContext) DeepCopyInto(out *ViolationContext)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.