Merge pull request #1550 from matheuscscp/fix-bucket-err-msg
Improve invalid proxy error message for Bucket API
This commit is contained in:
commit
58b4e6d719
|
@ -730,7 +730,7 @@ func (r *BucketReconciler) getProxyURL(ctx context.Context, obj *bucketv1.Bucket
|
||||||
address, ok := proxyData["address"]
|
address, ok := proxyData["address"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, fmt.Errorf("invalid proxy secret '%s/%s': key 'address' is missing",
|
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))
|
proxyURL, err := url.Parse(string(address))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -589,7 +589,7 @@ func TestBucketReconciler_reconcileSource_generic(t *testing.T) {
|
||||||
assertConditions: []metav1.Condition{
|
assertConditions: []metav1.Condition{
|
||||||
*conditions.TrueCondition(meta.ReconcilingCondition, meta.ProgressingReason, "foo"),
|
*conditions.TrueCondition(meta.ReconcilingCondition, meta.ProgressingReason, "foo"),
|
||||||
*conditions.UnknownCondition(meta.ReadyCondition, "foo", "bar"),
|
*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{},
|
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",
|
name: "invalid address in proxySecretRef",
|
||||||
|
|
Loading…
Reference in New Issue