Skip to content

Commit

Permalink
Align some go structs better
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
JustinKuli committed Jul 4, 2024
1 parent b299115 commit 78ea018
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions api/v1beta1/target.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions test/fakepolicy/api/v1beta1/fakepolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 78ea018

Please sign in to comment.