@@ -2,11 +2,14 @@ package acr_controller
22
33import (
44 "context"
5+ "crypto/tls"
56 "fmt"
67 "net"
78 "net/http"
89 "time"
910
11+ applisters "github.com/argoproj/argo-cd/v3/pkg/client/listers/application/v1alpha1"
12+ settings_util "github.com/argoproj/argo-cd/v3/util/settings"
1013 "github.com/redis/go-redis/v9"
1114 log "github.com/sirupsen/logrus"
1215 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -33,11 +36,15 @@ var backoff = wait.Backoff{
3336type ACRServer struct {
3437 ACRServerOpts
3538
39+ settings * settings_util.ArgoCDSettings
40+ log * log.Entry
3641 appInformer cache.SharedIndexInformer
42+ appLister applisters.ApplicationLister
3743 applicationClientset appclientset.Interface
3844
3945 // stopCh is the channel which when closed, will shutdown the Event Reporter server
40- stopCh chan struct {}
46+ stopCh chan struct {}
47+ serviceSet * ACRServerSet
4148}
4249
4350type ACRServerSet struct {}
@@ -156,6 +163,10 @@ func (a *ACRServer) Listen() (*Listeners, error) {
156163// golang/protobuf).
157164func (a * ACRServer ) Run (ctx context.Context , lns * Listeners ) {
158165 httpS := a .newHTTPServer (ctx , a .ListenPort )
166+ tlsConfig := tls.Config {}
167+ tlsConfig .GetCertificate = func (_ * tls.ClientHelloInfo ) (* tls.Certificate , error ) {
168+ return a .settings .Certificate , nil
169+ }
159170 go func () { a .checkServeErr ("httpS" , httpS .Serve (lns .Main )) }()
160171 go a .RunController (ctx )
161172
@@ -176,10 +187,13 @@ func NewApplicationChangeRevisionServer(_ context.Context, opts ACRServerOpts) *
176187 appFactory := appinformer .NewSharedInformerFactoryWithOptions (opts .AppClientset , 0 , appinformer .WithNamespace (appInformerNs ), appinformer .WithTweakListOptions (func (_ * metav1.ListOptions ) {}))
177188
178189 appInformer := appFactory .Argoproj ().V1alpha1 ().Applications ().Informer ()
190+ appLister := appFactory .Argoproj ().V1alpha1 ().Applications ().Lister ()
179191
180192 server := & ACRServer {
181193 ACRServerOpts : opts ,
194+ log : log .NewEntry (log .StandardLogger ()),
182195 appInformer : appInformer ,
196+ appLister : appLister ,
183197 applicationClientset : opts .AppClientset ,
184198 }
185199
0 commit comments