diff --git a/internal/controller/bucket_controller.go b/internal/controller/bucket_controller.go index 5d6ee25c5..656e5d704 100644 --- a/internal/controller/bucket_controller.go +++ b/internal/controller/bucket_controller.go @@ -730,7 +730,7 @@ func (r *BucketReconciler) getProxyURL(ctx context.Context, obj *bucketv1.Bucket address, ok := proxyData["address"] if !ok { return nil, fmt.Errorf("invalid proxy secret '%s/%s': key 'address' is missing", - obj.Spec.ProxySecretRef.Name, namespace) + namespace, obj.Spec.ProxySecretRef.Name) } proxyURL, err := url.Parse(string(address)) if err != nil { diff --git a/internal/controller/bucket_controller_test.go b/internal/controller/bucket_controller_test.go index 51b1aae2f..11c99613f 100644 --- a/internal/controller/bucket_controller_test.go +++ b/internal/controller/bucket_controller_test.go @@ -589,7 +589,7 @@ func TestBucketReconciler_reconcileSource_generic(t *testing.T) { assertConditions: []metav1.Condition{ *conditions.TrueCondition(meta.ReconcilingCondition, meta.ProgressingReason, "foo"), *conditions.UnknownCondition(meta.ReadyCondition, "foo", "bar"), - *conditions.TrueCondition(sourcev1.FetchFailedCondition, sourcev1.AuthenticationFailedReason, "invalid proxy secret 'dummy/': key 'address' is missing"), + *conditions.TrueCondition(sourcev1.FetchFailedCondition, sourcev1.AuthenticationFailedReason, "invalid proxy secret '/dummy': key 'address' is missing"), }, }, { @@ -1622,7 +1622,7 @@ func TestBucketReconciler_getProxyURL(t *testing.T) { Data: map[string][]byte{}, }, }, - expectedErr: "invalid proxy secret 'dummy/': key 'address' is missing", + expectedErr: "invalid proxy secret '/dummy': key 'address' is missing", }, { name: "invalid address in proxySecretRef",