@@ -2,7 +2,6 @@ package acr_controller
22
33import (
44 "context"
5- "crypto/tls"
65 "fmt"
76 "net"
87 "net/http"
@@ -20,10 +19,8 @@ import (
2019
2120 appclientset "github.com/argoproj/argo-cd/v3/pkg/client/clientset/versioned"
2221 appinformer "github.com/argoproj/argo-cd/v3/pkg/client/informers/externalversions"
23- applisters "github.com/argoproj/argo-cd/v3/pkg/client/listers/application/v1alpha1"
2422 servercache "github.com/argoproj/argo-cd/v3/server/cache"
2523 "github.com/argoproj/argo-cd/v3/util/healthz"
26- settings_util "github.com/argoproj/argo-cd/v3/util/settings"
2724)
2825
2926var backoff = wait.Backoff {
@@ -36,15 +33,11 @@ var backoff = wait.Backoff{
3633type ACRServer struct {
3734 ACRServerOpts
3835
39- settings * settings_util.ArgoCDSettings
40- log * log.Entry
4136 appInformer cache.SharedIndexInformer
42- appLister applisters.ApplicationLister
4337 applicationClientset appclientset.Interface
4438
4539 // stopCh is the channel which when closed, will shutdown the Event Reporter server
46- stopCh chan struct {}
47- serviceSet * ACRServerSet
40+ stopCh chan struct {}
4841}
4942
5043type ACRServerSet struct {}
@@ -100,12 +93,10 @@ func (a *ACRServer) healthCheck(_ *http.Request) error {
10093// Init starts informers used by the API server
10194func (a * ACRServer ) Init (ctx context.Context ) {
10295 go a .appInformer .Run (ctx .Done ())
103- svcSet := newApplicationChangeRevisionServiceSet ()
104- a .serviceSet = svcSet
10596}
10697
10798func (a * ACRServer ) RunController (ctx context.Context ) {
108- controller := acr_controller .NewApplicationChangeRevisionController (a .appInformer , a .Cache , a . ApplicationServiceClient , a . appLister , a .applicationClientset )
99+ controller := acr_controller .NewApplicationChangeRevisionController (a .appInformer , a .ApplicationServiceClient , a .applicationClientset )
109100 go controller .Run (ctx )
110101}
111102
@@ -164,10 +155,6 @@ func (a *ACRServer) Listen() (*Listeners, error) {
164155// golang/protobuf).
165156func (a * ACRServer ) Run (ctx context.Context , lns * Listeners ) {
166157 httpS := a .newHTTPServer (ctx , a .ListenPort )
167- tlsConfig := tls.Config {}
168- tlsConfig .GetCertificate = func (_ * tls.ClientHelloInfo ) (* tls.Certificate , error ) {
169- return a .settings .Certificate , nil
170- }
171158 go func () { a .checkServeErr ("httpS" , httpS .Serve (lns .Main )) }()
172159 go a .RunController (ctx )
173160
@@ -179,7 +166,7 @@ func (a *ACRServer) Run(ctx context.Context, lns *Listeners) {
179166 <- a .stopCh
180167}
181168
182- // NewServer returns a new instance of the Event Reporter server
169+ // NewApplicationChangeRevisionServer returns a new instance of the Event Reporter server
183170func NewApplicationChangeRevisionServer (_ context.Context , opts ACRServerOpts ) * ACRServer {
184171 appInformerNs := opts .Namespace
185172 if len (opts .ApplicationNamespaces ) > 0 {
@@ -188,19 +175,12 @@ func NewApplicationChangeRevisionServer(_ context.Context, opts ACRServerOpts) *
188175 appFactory := appinformer .NewSharedInformerFactoryWithOptions (opts .AppClientset , 0 , appinformer .WithNamespace (appInformerNs ), appinformer .WithTweakListOptions (func (_ * metav1.ListOptions ) {}))
189176
190177 appInformer := appFactory .Argoproj ().V1alpha1 ().Applications ().Informer ()
191- appLister := appFactory .Argoproj ().V1alpha1 ().Applications ().Lister ()
192178
193179 server := & ACRServer {
194180 ACRServerOpts : opts ,
195- log : log .NewEntry (log .StandardLogger ()),
196181 appInformer : appInformer ,
197- appLister : appLister ,
198182 applicationClientset : opts .AppClientset ,
199183 }
200184
201185 return server
202186}
203-
204- func newApplicationChangeRevisionServiceSet () * ACRServerSet {
205- return & ACRServerSet {}
206- }
0 commit comments