From 78ea0183829bbdb93d4a25b19cf104e67d30da92 Mon Sep 17 00:00:00 2001 From: Justin Kulikauskas <44813129+JustinKuli@users.noreply.github.com> Date: Thu, 4 Jul 2024 02:41:37 +0000 Subject: [PATCH] Align some go structs better This utilized https://github.com/dkorunic/betteralign. Not all structs will be perfect, and I don't think it's necessary to figure out how to declare exceptions in order to run this in CI. Signed-off-by: Justin Kulikauskas <44813129+JustinKuli@users.noreply.github.com> --- api/v1beta1/target.go | 8 ++++---- test/fakepolicy/api/v1beta1/fakepolicy_types.go | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) 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