Fix missing namespace in Helm Repository Controller secret error
Signed-off-by: cappyzawa <cappyzawa@gmail.com>
This commit is contained in:
parent
4b18040e22
commit
9463bcf0ee
|
@ -1035,12 +1035,12 @@ func TestHelmChartReconciler_buildFromHelmRepository(t *testing.T) {
|
|||
}
|
||||
},
|
||||
want: sreconcile.ResultEmpty,
|
||||
wantErr: &serror.Generic{Err: errors.New("failed to get authentication secret: secrets \"invalid\" not found")},
|
||||
wantErr: &serror.Generic{Err: errors.New("failed to get authentication secret '/invalid': secrets \"invalid\" not found")},
|
||||
assertFunc: func(g *WithT, obj *sourcev1.HelmChart, build chart.Build) {
|
||||
g.Expect(build.Complete()).To(BeFalse())
|
||||
|
||||
g.Expect(obj.Status.Conditions).To(conditions.MatchConditions([]metav1.Condition{
|
||||
*conditions.TrueCondition(sourcev1.FetchFailedCondition, sourcev1.AuthenticationFailedReason, "failed to get authentication secret: secrets \"invalid\" not found"),
|
||||
*conditions.TrueCondition(sourcev1.FetchFailedCondition, sourcev1.AuthenticationFailedReason, "failed to get authentication secret '/invalid': secrets \"invalid\" not found"),
|
||||
}))
|
||||
},
|
||||
},
|
||||
|
@ -1304,12 +1304,12 @@ func TestHelmChartReconciler_buildFromOCIHelmRepository(t *testing.T) {
|
|||
}
|
||||
},
|
||||
want: sreconcile.ResultEmpty,
|
||||
wantErr: &serror.Generic{Err: errors.New("failed to get authentication secret: secrets \"invalid\" not found")},
|
||||
wantErr: &serror.Generic{Err: errors.New("failed to get authentication secret '/invalid': secrets \"invalid\" not found")},
|
||||
assertFunc: func(g *WithT, obj *sourcev1.HelmChart, build chart.Build) {
|
||||
g.Expect(build.Complete()).To(BeFalse())
|
||||
|
||||
g.Expect(obj.Status.Conditions).To(conditions.MatchConditions([]metav1.Condition{
|
||||
*conditions.TrueCondition(sourcev1.FetchFailedCondition, sourcev1.AuthenticationFailedReason, "failed to get authentication secret: secrets \"invalid\" not found"),
|
||||
*conditions.TrueCondition(sourcev1.FetchFailedCondition, sourcev1.AuthenticationFailedReason, "failed to get authentication secret '/invalid': secrets \"invalid\" not found"),
|
||||
}))
|
||||
},
|
||||
},
|
||||
|
|
|
@ -118,7 +118,8 @@ func configureAuthentication(ctx context.Context, c client.Client, obj *sourcev1
|
|||
if obj.Spec.CertSecretRef != nil {
|
||||
secret, err := fetchSecret(ctx, c, obj.Spec.CertSecretRef.Name, obj.GetNamespace())
|
||||
if err != nil {
|
||||
return false, nil, nil, fmt.Errorf("failed to get TLS authentication secret: %w", err)
|
||||
secretRef := types.NamespacedName{Namespace: obj.GetNamespace(), Name: obj.Spec.CertSecretRef.Name}
|
||||
return false, nil, nil, fmt.Errorf("failed to get TLS authentication secret '%s': %w", secretRef, err)
|
||||
}
|
||||
certSecret = secret
|
||||
|
||||
|
@ -138,7 +139,8 @@ func configureAuthentication(ctx context.Context, c client.Client, obj *sourcev1
|
|||
if obj.Spec.SecretRef != nil {
|
||||
secret, err := fetchSecret(ctx, c, obj.Spec.SecretRef.Name, obj.GetNamespace())
|
||||
if err != nil {
|
||||
return false, nil, nil, fmt.Errorf("failed to get authentication secret: %w", err)
|
||||
secretRef := types.NamespacedName{Namespace: obj.GetNamespace(), Name: obj.Spec.SecretRef.Name}
|
||||
return false, nil, nil, fmt.Errorf("failed to get authentication secret '%s': %w", secretRef, err)
|
||||
}
|
||||
authSecret = secret
|
||||
|
||||
|
|
Loading…
Reference in New Issue