@@ -93,12 +93,15 @@ func main() {
9393 watchOptions helper.WatchOptions
9494 concurrent int
9595 tokenCacheOptions cache.TokenFlags
96+ defaultServiceAccount string
9697 )
9798
9899 flag .StringVar (& metricsAddr , "metrics-addr" , ":8080" , "The address the metric endpoint binds to." )
99100 flag .StringVar (& eventsAddr , "events-addr" , "" , "The address of the events receiver." )
100101 flag .StringVar (& healthAddr , "health-addr" , ":9440" , "The address the health endpoint binds to." )
101102 flag .IntVar (& concurrent , "concurrent" , 4 , "The number of concurrent resource reconciles." )
103+ flag .StringVar (& defaultServiceAccount , auth .ControllerFlagDefaultServiceAccount ,
104+ "" , "Default service account to use for workload identity when not specified in resources." )
102105 flag .StringSliceVar (& git .KexAlgos , "ssh-kex-algos" , []string {},
103106 "The list of key exchange algorithms to use for ssh connections, arranged from most preferred to the least." )
104107 flag .StringSliceVar (& git .HostKeyAlgos , "ssh-hostkey-algos" , []string {},
@@ -115,6 +118,10 @@ func main() {
115118
116119 flag .Parse ()
117120
121+ if defaultServiceAccount != "" {
122+ auth .SetDefaultServiceAccount (defaultServiceAccount )
123+ }
124+
118125 logger .SetLogger (logger .NewLogger (logOptions ))
119126
120127 err := featureGates .WithLogger (setupLog ).
0 commit comments