Skip to content

Commit

Permalink
Merge pull request #1550 from matheuscscp/fix-bucket-err-msg
Browse files Browse the repository at this point in the history
Improve invalid proxy error message for Bucket API
  • Loading branch information
darkowlzz authored Jul 16, 2024
2 parents 54cb2d8 + 8d19782 commit 58b4e6d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/controller/bucket_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions internal/controller/bucket_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
},
},
{
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 58b4e6d

Please sign in to comment.