diff --git a/api/v1beta1/target.go b/api/v1beta1/target.go index eb0265b..5997e52 100644 --- a/api/v1beta1/target.go +++ b/api/v1beta1/target.go @@ -16,15 +16,15 @@ import ( type Target struct { *metav1.LabelSelector `json:",inline"` + // Namespace is the namespace to restrict the Target to. Can be empty for non-namespaced + // objects, or to look in all namespaces. + Namespace string `json:"namespace,omitempty"` + // Include is a list of filepath expressions to include objects by name. Include []NonEmptyString `json:"include,omitempty"` // Exclude is a list of filepath expressions to include objects by name. Exclude []NonEmptyString `json:"exclude,omitempty"` - - // Namespace is the namespace to restrict the Target to. Can be empty for non-namespaced - // objects, or to look in all namespaces. - Namespace string `json:"namespace,omitempty"` } //+kubebuilder:object:generate=false diff --git a/test/fakepolicy/api/v1beta1/fakepolicy_types.go b/test/fakepolicy/api/v1beta1/fakepolicy_types.go index 1cddce7..84899e9 100644 --- a/test/fakepolicy/api/v1beta1/fakepolicy_types.go +++ b/test/fakepolicy/api/v1beta1/fakepolicy_types.go @@ -15,15 +15,15 @@ type FakePolicySpec struct { // TargetConfigMaps defines the ConfigMaps which should be examined by this policy TargetConfigMaps nucleusv1beta1.Target `json:"targetConfigMaps,omitempty"` - // TargetUsingReflection defines whether to use reflection to find the ConfigMaps - TargetUsingReflection bool `json:"targetUsingReflection,omitempty"` - // DesiredConfigMapName - if this name is not found, the policy will report a violation DesiredConfigMapName string `json:"desiredConfigMapName,omitempty"` // EventAnnotation - if provided, this value will be annotated on the compliance // events, under the "policy.open-cluster-management.io/test" key EventAnnotation string `json:"eventAnnotation,omitempty"` + + // TargetUsingReflection defines whether to use reflection to find the ConfigMaps + TargetUsingReflection bool `json:"targetUsingReflection,omitempty"` } //+kubebuilder:validation:Optional