Skip to content

Commit e33c41d

Browse files
committed
fix lint
1 parent 4b4dd78 commit e33c41d

File tree

6 files changed

+21
-21
lines changed

6 files changed

+21
-21
lines changed

api/v1alpha1/metric_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ func (r *Metric) GvkToString() string {
116116
return fmt.Sprintf("%s/%s, Kind=%s", r.Spec.Target.Group, r.Spec.Target.Version, r.Spec.Target.Kind)
117117
}
118118

119-
//+kubebuilder:object:root=true
119+
// +kubebuilder:object:root=true
120120

121121
// MetricList contains a list of Metric
122122
type MetricList struct {

cmd/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import (
4444
"github.com/openmcp-project/metrics-operator/internal/controller"
4545

4646
metricsv1alpha1 "github.com/openmcp-project/metrics-operator/api/v1alpha1"
47-
//+kubebuilder:scaffold:imports
47+
// +kubebuilder:scaffold:imports
4848
)
4949

5050
var _ = api.Target{}
@@ -65,7 +65,7 @@ func init() {
6565
utilruntime.Must(apiextensionsv1.AddToScheme(scheme))
6666

6767
utilruntime.Must(metricsv1alpha1.AddToScheme(scheme))
68-
//+kubebuilder:scaffold:scheme
68+
// +kubebuilder:scaffold:scheme
6969
}
7070

7171
func runInit(setupClient client.Client) {
@@ -176,7 +176,7 @@ func main() {
176176

177177
setupFederatedManagedMetricController(mgr)
178178

179-
//+kubebuilder:scaffold:builder
179+
// +kubebuilder:scaffold:builder
180180

181181
if err := mgr.AddHealthzCheck("healthz", healthz.Ping); err != nil {
182182
setupLog.Error(err, "unable to set up health check")

internal/controller/federatedmanagedmetric_controller.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ func (r *FederatedManagedMetricReconciler) handleGetError(err error, log logr.Lo
8585
return ctrl.Result{RequeueAfter: RequeueAfterError}, err
8686
}
8787

88-
func (r *FederatedManagedMetricReconciler) scheduleNextReconciliation(metric *v1alpha1.FederatedManagedMetric) (ctrl.Result, error) {
88+
func (r *FederatedManagedMetricReconciler) scheduleNextReconciliation(metric *v1alpha1.FederatedManagedMetric) ctrl.Result {
8989

9090
elapsed := time.Since(metric.Status.LastReconcileTime.Time)
9191
return ctrl.Result{
9292
RequeueAfter: metric.Spec.Interval.Duration - elapsed,
93-
}, nil
93+
}
9494
}
9595

9696
func (r *FederatedManagedMetricReconciler) shouldReconcile(metric *v1alpha1.FederatedManagedMetric) bool {
@@ -139,7 +139,7 @@ func (r *FederatedManagedMetricReconciler) Reconcile(ctx context.Context, req ct
139139

140140
// Check if enough time has passed since the last reconciliation
141141
if !r.shouldReconcile(&metric) {
142-
return r.scheduleNextReconciliation(&metric)
142+
return r.scheduleNextReconciliation(&metric), nil
143143
}
144144

145145
/*

internal/controller/federatedmetric_controller.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@ func handleGetError(err error, log logr.Logger) (ctrl.Result, error) {
8686
return ctrl.Result{RequeueAfter: RequeueAfterError}, err
8787
}
8888

89-
func scheduleNextReconciliation(metric *v1alpha1.FederatedMetric) (ctrl.Result, error) {
89+
func scheduleNextReconciliation(metric *v1alpha1.FederatedMetric) ctrl.Result {
9090

9191
elapsed := time.Since(metric.Status.LastReconcileTime.Time)
9292
return ctrl.Result{
9393
RequeueAfter: metric.Spec.Interval.Duration - elapsed,
94-
}, nil
94+
}
9595
}
9696

9797
func shouldReconcile(metric *v1alpha1.FederatedMetric) bool {
@@ -141,7 +141,7 @@ func (r *FederatedMetricReconciler) Reconcile(ctx context.Context, req ctrl.Requ
141141

142142
// Check if enough time has passed since the last reconciliation
143143
if !shouldReconcile(&metric) {
144-
return scheduleNextReconciliation(&metric)
144+
return scheduleNextReconciliation(&metric), nil
145145
}
146146

147147
/*

internal/controller/managedmetric_controller.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ func (r *ManagedMetricReconciler) getRestConfig() *rest.Config {
6262
return r.inRestConfig
6363
}
6464

65-
func (r *ManagedMetricReconciler) scheduleNextReconciliation(metric *v1alpha1.ManagedMetric) (ctrl.Result, error) {
65+
func (r *ManagedMetricReconciler) scheduleNextReconciliation(metric *v1alpha1.ManagedMetric) ctrl.Result {
6666
elapsed := time.Since(metric.Status.Observation.Timestamp.Time)
6767
return ctrl.Result{
6868
RequeueAfter: metric.Spec.Interval.Duration - elapsed,
69-
}, nil
69+
}
7070
}
7171

7272
func (r *ManagedMetricReconciler) shouldReconcile(metric *v1alpha1.ManagedMetric) bool {
@@ -92,11 +92,11 @@ func (r *ManagedMetricReconciler) getDataSinkCredentials(ctx context.Context, ma
9292
return retriever.GetDataSinkCredentials(ctx, managedMetric.Spec.DataSinkRef, managedMetric, l)
9393
}
9494

95-
//+kubebuilder:rbac:groups=metrics.openmcp.cloud,resources=managedmetrics,verbs=get;list;watch;create;update;patch;delete
96-
//+kubebuilder:rbac:groups=metrics.openmcp.cloud,resources=managedmetrics/status,verbs=get;update;patch
97-
//+kubebuilder:rbac:groups=metrics.openmcp.cloud,resources=managedmetrics/finalizers,verbs=update
98-
//+kubebuilder:rbac:groups=metrics.openmcp.cloud,resources=datasinks,verbs=get;list;watch
99-
//+kubebuilder:rbac:groups="",resources=secrets,verbs=get
95+
// +kubebuilder:rbac:groups=metrics.openmcp.cloud,resources=managedmetrics,verbs=get;list;watch;create;update;patch;delete
96+
// +kubebuilder:rbac:groups=metrics.openmcp.cloud,resources=managedmetrics/status,verbs=get;update;patch
97+
// +kubebuilder:rbac:groups=metrics.openmcp.cloud,resources=managedmetrics/finalizers,verbs=update
98+
// +kubebuilder:rbac:groups=metrics.openmcp.cloud,resources=datasinks,verbs=get;list;watch
99+
// +kubebuilder:rbac:groups="",resources=secrets,verbs=get
100100

101101
// Reconcile is part of the main kubernetes reconciliation loop which aims to
102102
// move the current state of the cluster closer to the desired state.
@@ -138,7 +138,7 @@ func (r *ManagedMetricReconciler) Reconcile(ctx context.Context, req ctrl.Reques
138138

139139
// Check if enough time has passed since the last reconciliation
140140
if !r.shouldReconcile(&metric) {
141-
return r.scheduleNextReconciliation(&metric)
141+
return r.scheduleNextReconciliation(&metric), nil
142142
}
143143

144144
/*

internal/controller/metric_controller.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ func (r *MetricReconciler) getDataSinkCredentials(ctx context.Context, metric *v
8181
return retriever.GetDataSinkCredentials(ctx, metric.Spec.DataSinkRef, metric, l)
8282
}
8383

84-
func (r *MetricReconciler) scheduleNextReconciliation(metric *v1alpha1.Metric) (ctrl.Result, error) {
84+
func (r *MetricReconciler) scheduleNextReconciliation(metric *v1alpha1.Metric) ctrl.Result {
8585

8686
elapsed := time.Since(metric.Status.Observation.Timestamp.Time)
8787
return ctrl.Result{
8888
RequeueAfter: metric.Spec.Interval.Duration - elapsed,
89-
}, nil
89+
}
9090
}
9191

9292
func (r *MetricReconciler) shouldReconcile(metric *v1alpha1.Metric) bool {
@@ -146,7 +146,7 @@ func (r *MetricReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctr
146146

147147
// Check if enough time has passed since the last reconciliation
148148
if !r.shouldReconcile(&metric) {
149-
return r.scheduleNextReconciliation(&metric)
149+
return r.scheduleNextReconciliation(&metric), nil
150150
}
151151

152152
/*

0 commit comments

Comments
 (0)