Skip to content

Commit 474790d

Browse files
author
Ariel Kass
committed
another attempt to reresolve linter issues #4
Signed-off-by: Ariel Kass <[email protected]>
1 parent 9c5104a commit 474790d

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

controllers/pvc_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,17 @@ var mockPersistentVolumeClaim = &corev1.PersistentVolumeClaim{
8080

8181
func createFakeScheme(t *testing.T) *runtime.Scheme {
8282
t.Helper()
83+
8384
scheme, err := replicationv1alpha1.SchemeBuilder.Build()
8485
if err != nil {
8586
require.Fail(t, "unable to build scheme")
8687
}
88+
8789
err = corev1.AddToScheme(scheme)
8890
if err != nil {
8991
require.Fail(t, "failed to add corev1 scheme")
9092
}
93+
9194
err = replicationv1alpha1.AddToScheme(scheme)
9295
if err != nil {
9396
require.Fail(t, "failed to add replicationv1alpha1 scheme")
@@ -98,6 +101,7 @@ func createFakeScheme(t *testing.T) *runtime.Scheme {
98101

99102
func createFakeVolumeReplicationReconciler(t *testing.T, obj ...runtime.Object) VolumeReplicationReconciler {
100103
t.Helper()
104+
101105
scheme := createFakeScheme(t)
102106
client := fake.NewClientBuilder().WithScheme(scheme).WithRuntimeObjects(obj...).Build()
103107

controllers/volumereplication_controller.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ func (r *VolumeReplicationReconciler) Reconcile(ctx context.Context, req ctrl.Re
116116
if err != nil {
117117
logger.Error(err, "failed to validate parameters of volumeReplicationClass", "VRCName", instance.Spec.VolumeReplicationClass)
118118
setFailureCondition(instance)
119+
119120
uErr := r.updateReplicationStatus(ctx, instance, logger, getCurrentReplicationState(instance), err.Error())
120121
if uErr != nil {
121122
logger.Error(uErr, "failed to update volumeReplication status", "VRName", instance.Name)
@@ -179,6 +180,7 @@ func (r *VolumeReplicationReconciler) Reconcile(ctx context.Context, req ctrl.Re
179180
if vgErr != nil {
180181
logger.Error(vgErr, "failed to get VG", "VGName", instance.Spec.DataSource.Name)
181182
setFailureCondition(instance)
183+
182184
uErr := r.updateReplicationStatus(ctx, instance, logger, getCurrentReplicationState(instance), vgErr.Error())
183185
if uErr != nil {
184186
logger.Error(uErr, "failed to update volumeReplication status", "VRName", instance.Name)
@@ -192,6 +194,7 @@ func (r *VolumeReplicationReconciler) Reconcile(ctx context.Context, req ctrl.Re
192194
err = fmt.Errorf("unsupported datasource kind")
193195
logger.Error(err, "given kind not supported", "Kind", instance.Spec.DataSource.Kind)
194196
setFailureCondition(instance)
197+
195198
uErr := r.updateReplicationStatus(ctx, instance, logger, getCurrentReplicationState(instance), err.Error())
196199
if uErr != nil {
197200
logger.Error(uErr, "failed to update volumeReplication status", "VRName", instance.Name)

main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ func init() {
6363

6464
func main() {
6565
var metricsAddr string
66+
6667
var leaderElectionNamespace string
68+
6769
var probeAddr string
6870

6971
var enableLeaderElection bool

0 commit comments

Comments
 (0)