Skip to content

Commit 96b4762

Browse files
committed
Error string shouldn't be capitalized
1 parent 9b84a28 commit 96b4762

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

controllers/reconcile_persistence.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func (r *RabbitmqClusterReconciler) reconcilePVC(ctx context.Context, rmq *rabbi
1818
err := scaling.NewPersistenceScaler(r.Clientset).Scale(ctx, *rmq, desiredCapacity)
1919
if err != nil {
2020
msg := fmt.Sprintf("Failed to scale PVCs: %s", err.Error())
21-
logger.Error(fmt.Errorf("Hit an error while scaling PVC capacity: %w", err), msg)
21+
logger.Error(fmt.Errorf("hit an error while scaling PVC capacity: %w", err), msg)
2222
r.Recorder.Event(rmq, corev1.EventTypeWarning, "FailedReconcilePersistence", msg)
2323
}
2424
return err

internal/metadata/annotation_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package metadata_test
33
import (
44
. "github.com/onsi/ginkgo/v2"
55
. "github.com/onsi/gomega"
6-
internal_metadata "github.com/rabbitmq/cluster-operator/internal/metadata"
6+
internalmetadata "github.com/rabbitmq/cluster-operator/internal/metadata"
77
)
88

99
var _ = Describe("Annotation", func() {
@@ -16,7 +16,7 @@ var _ = Describe("Annotation", func() {
1616

1717
DescribeTable("Reconcile annotations",
1818
func(expectedAnnotations map[string]string, existingAnnotations map[string]string, defaultAnnotations ...map[string]string) {
19-
reconciledAnnotations := internal_metadata.ReconcileAnnotations(existingAnnotations, defaultAnnotations...)
19+
reconciledAnnotations := internalmetadata.ReconcileAnnotations(existingAnnotations, defaultAnnotations...)
2020
Expect(reconciledAnnotations).To(Equal(expectedAnnotations))
2121
},
2222

@@ -55,7 +55,7 @@ var _ = Describe("Annotation", func() {
5555

5656
DescribeTable("Reconcile and filter annotations",
5757
func(expectedAnnotations map[string]string, existingAnnotations map[string]string, defaultAnnotations ...map[string]string) {
58-
reconciledAnnotations := internal_metadata.ReconcileAndFilterAnnotations(existingAnnotations, defaultAnnotations...)
58+
reconciledAnnotations := internalmetadata.ReconcileAndFilterAnnotations(existingAnnotations, defaultAnnotations...)
5959
Expect(reconciledAnnotations).To(Equal(expectedAnnotations))
6060
},
6161

internal/scaling/scaling.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func (p PersistenceScaler) Scale(ctx context.Context, rmq rabbitmqv1beta1.Rabbit
3434

3535
existingCapacity, err := p.existingCapacity(ctx, rmq)
3636
if client.IgnoreNotFound(err) != nil {
37-
logErr := fmt.Errorf("Failed to determine existing STS capactiy: %w", err)
37+
logErr := fmt.Errorf("failed to determine existing STS capactiy: %w", err)
3838
logger.Error(logErr, "Could not read sts")
3939
return logErr
4040
}
@@ -65,7 +65,7 @@ func (p PersistenceScaler) Scale(ctx context.Context, rmq rabbitmqv1beta1.Rabbit
6565
logger.Info("Scaling up PVCs", "RabbitmqCluster", rmq.Name, "pvcsToBeScaled", pvcsToBeScaled)
6666

6767
if err := p.deleteSts(ctx, rmq); err != nil {
68-
logErr := fmt.Errorf("Failed to delete Statefulset from Kubernetes API: %w", err)
68+
logErr := fmt.Errorf("failed to delete Statefulset from Kubernetes API: %w", err)
6969
logger.Error(logErr, "Could not delete existing sts")
7070
return logErr
7171
}
@@ -82,7 +82,7 @@ func (p PersistenceScaler) getClusterPVCs(ctx context.Context, rmq rabbitmqv1bet
8282
for i = 0; i < pointer.Int32Deref(rmq.Spec.Replicas, 1); i++ {
8383
pvc, err := p.Client.CoreV1().PersistentVolumeClaims(rmq.Namespace).Get(ctx, rmq.PVCName(int(i)), metav1.GetOptions{})
8484
if client.IgnoreNotFound(err) != nil {
85-
logErr := fmt.Errorf("Failed to get PVC from Kubernetes API: %w", err)
85+
logErr := fmt.Errorf("failed to get PVC from Kubernetes API: %w", err)
8686
logger.Error(logErr, "Could not read existing PVC")
8787
return nil, logErr
8888
}
@@ -137,7 +137,7 @@ func (p PersistenceScaler) deleteSts(ctx context.Context, rmq rabbitmqv1beta1.Ra
137137

138138
sts, err := p.getSts(ctx, rmq)
139139
if client.IgnoreNotFound(err) != nil {
140-
logErr := fmt.Errorf("Failed to get statefulset from Kubernetes API: %w", err)
140+
logErr := fmt.Errorf("failed to get statefulset from Kubernetes API: %w", err)
141141
logger.Error(logErr, "Could not read existing statefulset")
142142
return logErr
143143
}
@@ -174,7 +174,7 @@ func (p PersistenceScaler) scaleUpPVCs(ctx context.Context, rmq rabbitmqv1beta1.
174174
// To minimise any timing windows, retrieve the latest version of this PVC before updating
175175
pvc, err := p.Client.CoreV1().PersistentVolumeClaims(pvc.Namespace).Get(ctx, pvc.Name, metav1.GetOptions{})
176176
if err != nil {
177-
logErr := fmt.Errorf("Failed to get PVC from Kubernetes API: %w", err)
177+
logErr := fmt.Errorf("failed to get PVC from Kubernetes API: %w", err)
178178
logger.Error(logErr, "Could not read existing PVC")
179179
return logErr
180180
}

internal/scaling/scaling_suite_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ func (matcher *UpdateActionMatcher) Match(actual interface{}) (bool, error) {
201201
updatedObject := reflect.ValueOf(action.GetObject()).Elem()
202202
objMeta, ok := updatedObject.FieldByName("ObjectMeta").Interface().(metav1.ObjectMeta)
203203
if !ok {
204-
return false, fmt.Errorf("Object of action was not an object with ObjectMeta")
204+
return false, fmt.Errorf("object of action was not an object with ObjectMeta")
205205
}
206206

207207
// Check the object's Name, Namespace, resource type and the verb of the action first. If this fails, there's

0 commit comments

Comments
 (0)