Skip to content

Commit 94c8185

Browse files
committed
controllers: wire Azure Blob Bucket Provider
Signed-off-by: Hidde Beydals <[email protected]>
1 parent ec5bc1a commit 94c8185

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

controllers/bucket_controller.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
"sync"
2929
"time"
3030

31+
"github.com/fluxcd/source-controller/pkg/azure"
3132
"golang.org/x/sync/errgroup"
3233
"golang.org/x/sync/semaphore"
3334
corev1 "k8s.io/api/core/v1"
@@ -400,6 +401,17 @@ func (r *BucketReconciler) reconcileSource(ctx context.Context, obj *sourcev1.Bu
400401
conditions.MarkTrue(obj, sourcev1.FetchFailedCondition, e.Reason, e.Error())
401402
return sreconcile.ResultEmpty, e
402403
}
404+
case sourcev1.AzureBucketProvider:
405+
if err = azure.ValidateSecret(secret); err != nil {
406+
e := &serror.Event{Err: err, Reason: sourcev1.AuthenticationFailedReason}
407+
conditions.MarkTrue(obj, sourcev1.FetchFailedCondition, e.Reason, e.Error())
408+
return sreconcile.ResultEmpty, e
409+
}
410+
if provider, err = azure.NewClient(obj, secret); err != nil {
411+
e := &serror.Event{Err: err, Reason: "ClientError"}
412+
conditions.MarkTrue(obj, sourcev1.FetchFailedCondition, e.Reason, e.Error())
413+
return sreconcile.ResultEmpty, e
414+
}
403415
default:
404416
if err = minio.ValidateSecret(secret); err != nil {
405417
e := &serror.Event{Err: err, Reason: sourcev1.AuthenticationFailedReason}

0 commit comments

Comments
 (0)