Skip to content

Commit d1f2a2f

Browse files
dhaiducekopenshift-merge-bot[bot]
authored andcommitted
Align integer sizes to address G115
Signed-off-by: Dale Haiducek <[email protected]>
1 parent 4bbe2bd commit d1f2a2f

File tree

9 files changed

+21
-21
lines changed

9 files changed

+21
-21
lines changed

api/v1beta1/policyautomation_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ type AutomationDef struct {
5353
// is "1000".
5454
//
5555
// +kubebuilder:validation:Minimum=0
56-
PolicyViolationsLimit *uint `json:"policyViolationsLimit,omitempty"`
56+
PolicyViolationsLimit *uint16 `json:"policyViolationsLimit,omitempty"`
5757
}
5858

5959
// PolicyAutomationSpec defines how and when automation is initiated for the referenced policy.

api/v1beta1/zz_generated.deepcopy.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

controllers/automation/policyautomation_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ func (r *PolicyAutomationReconciler) getViolationContext(
196196

197197
policyViolationsLimit := policyAutomation.Spec.Automation.PolicyViolationsLimit
198198
if policyViolationsLimit == nil {
199-
policyViolationsLimit = new(uint)
199+
policyViolationsLimit = new(uint16)
200200
*policyViolationsLimit = policyv1beta1.DefaultPolicyViolationsLimit
201201
}
202202

controllers/encryptionkeys/encryptionkeys_controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ var (
3838
)
3939

4040
// SetupWithManager sets up the controller with the Manager.
41-
func (r *EncryptionKeysReconciler) SetupWithManager(mgr ctrl.Manager, maxConcurrentReconciles uint) error {
41+
func (r *EncryptionKeysReconciler) SetupWithManager(mgr ctrl.Manager, maxConcurrentReconciles uint16) error {
4242
return ctrl.NewControllerManagedBy(mgr).
4343
// The work queue prevents the same item being reconciled concurrently:
4444
// https://github.com/kubernetes-sigs/controller-runtime/issues/1416#issuecomment-899833144
@@ -55,7 +55,7 @@ var _ reconcile.Reconciler = &EncryptionKeysReconciler{}
5555
// for all managed clusters.
5656
type EncryptionKeysReconciler struct { //nolint:golint,revive
5757
client.Client
58-
KeyRotationDays uint
58+
KeyRotationDays uint32
5959
Scheme *runtime.Scheme
6060
}
6161

controllers/policymetrics/policymetrics_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const ControllerName string = "policy-metrics"
2424
var log = ctrl.Log.WithName(ControllerName)
2525

2626
// SetupWithManager sets up the controller with the Manager.
27-
func (r *MetricReconciler) SetupWithManager(mgr ctrl.Manager, maxConcurrentReconciles uint) error {
27+
func (r *MetricReconciler) SetupWithManager(mgr ctrl.Manager, maxConcurrentReconciles uint16) error {
2828
return ctrl.NewControllerManagedBy(mgr).
2929
// The work queue prevents the same item being reconciled concurrently:
3030
// https://github.com/kubernetes-sigs/controller-runtime/issues/1416#issuecomment-899833144

controllers/propagator/replicatedpolicy_setup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919

2020
func (r *ReplicatedPolicyReconciler) SetupWithManager(
2121
mgr ctrl.Manager,
22-
maxConcurrentReconciles uint,
22+
maxConcurrentReconciles uint16,
2323
dependenciesSource source.Source,
2424
updateSrc source.Source,
2525
templateSrc source.Source,

controllers/propagator/rootpolicy_setup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
//+kubebuilder:rbac:groups=*,resources=*,verbs=get;list;watch
2929

3030
// SetupWithManager sets up the controller with the Manager.
31-
func (r *RootPolicyReconciler) SetupWithManager(mgr ctrl.Manager, maxConcurrentReconciles uint) error {
31+
func (r *RootPolicyReconciler) SetupWithManager(mgr ctrl.Manager, maxConcurrentReconciles uint16) error {
3232
return ctrl.NewControllerManagedBy(mgr).
3333
WithOptions(controller.Options{MaxConcurrentReconciles: int(maxConcurrentReconciles)}).
3434
Named("root-policy-spec").

controllers/rootpolicystatus/root_policy_status_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ var log = ctrl.Log.WithName(ControllerName)
3232
// SetupWithManager sets up the controller with the Manager.
3333
func (r *RootPolicyStatusReconciler) SetupWithManager(
3434
mgr ctrl.Manager,
35-
maxConcurrentReconciles uint,
35+
maxConcurrentReconciles uint16,
3636
plrsEnabled bool,
3737
) error {
3838
ctrlBldr := ctrl.NewControllerManagedBy(mgr).

main.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,12 @@ func main() {
116116
secureMetrics bool
117117
enableLeaderElection bool
118118
probeAddr string
119-
keyRotationDays uint
120-
keyRotationMaxConcurrency uint
121-
policyMetricsMaxConcurrency uint
122-
policyStatusMaxConcurrency uint
123-
rootPolicyMaxConcurrency uint
124-
replPolicyMaxConcurrency uint
119+
keyRotationDays uint32
120+
keyRotationMaxConcurrency uint16
121+
policyMetricsMaxConcurrency uint16
122+
policyStatusMaxConcurrency uint16
123+
rootPolicyMaxConcurrency uint16
124+
replPolicyMaxConcurrency uint16
125125
enableWebhooks bool
126126
complianceAPIHost string
127127
complianceAPIPort string
@@ -143,37 +143,37 @@ func main() {
143143
"Enabling this will ensure there is only one active controller manager.")
144144
pflag.BoolVar(&enableWebhooks, "enable-webhooks", true,
145145
"Enable the policy validating webhook")
146-
pflag.UintVar(
146+
pflag.Uint32Var(
147147
&keyRotationDays,
148148
"encryption-key-rotation",
149149
30,
150150
"The number of days until the policy encryption key is rotated",
151151
)
152-
pflag.UintVar(
152+
pflag.Uint16Var(
153153
&keyRotationMaxConcurrency,
154154
"key-rotation-max-concurrency",
155155
10,
156156
"The maximum number of concurrent reconciles for the policy-encryption-keys controller",
157157
)
158-
pflag.UintVar(
158+
pflag.Uint16Var(
159159
&policyMetricsMaxConcurrency,
160160
"policy-metrics-max-concurrency",
161161
5,
162162
"The maximum number of concurrent reconciles for the policy-metrics controller",
163163
)
164-
pflag.UintVar(
164+
pflag.Uint16Var(
165165
&policyStatusMaxConcurrency,
166166
"policy-status-max-concurrency",
167167
5,
168168
"The maximum number of concurrent reconciles for the policy-status controller",
169169
)
170-
pflag.UintVar(
170+
pflag.Uint16Var(
171171
&rootPolicyMaxConcurrency,
172172
"root-policy-max-concurrency",
173173
2,
174174
"The maximum number of concurrent reconciles for the root-policy controller",
175175
)
176-
pflag.UintVar(
176+
pflag.Uint16Var(
177177
&replPolicyMaxConcurrency,
178178
"replicated-policy-max-concurrency",
179179
10,

0 commit comments

Comments
 (0)