File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ func (j *Janitor) Init() {
7979 j .Azure .SubscriptionsIterator = armclient .NewSubscriptionIterator (j .Azure .Client , j .Conf .Azure .Subscription ... )
8080
8181 j .initPrometheus ()
82- j .initAuzreApiVersions ()
82+ j .initAzureApiVersions ()
8383}
8484
8585func (j * Janitor ) Run () {
@@ -151,14 +151,16 @@ func (j *Janitor) Run() {
151151 }()
152152}
153153
154- func (j * Janitor ) initAuzreApiVersions () {
154+ func (j * Janitor ) initAzureApiVersions () {
155155 ctx := context .Background ()
156156
157157 j .apiVersionMap = map [string ]map [string ]string {}
158158
159159 err := j .Azure .SubscriptionsIterator .ForEach (j .Logger , func (subscription * armsubscriptions.Subscription , logger * zap.SugaredLogger ) {
160160 subscriptionId := to .String (subscription .SubscriptionID )
161161
162+ j .Logger .With (zap .String ("subscriptionID" , subscriptionId )).Infof (`fetch Azure available api-versions` )
163+
162164 // fetch location translation map
163165 subscriptionClient , err := armsubscriptions .NewClient (j .Azure .Client .GetCred (), j .Azure .Client .NewArmClientOptions ())
164166 if err != nil {
Original file line number Diff line number Diff line change @@ -46,17 +46,19 @@ func main() {
4646 initAzureConnection ()
4747
4848 logger .Infof ("init Janitor" )
49- j := janitor.Janitor {
50- Conf : Opts ,
51- UserAgent : UserAgent + gitTag ,
52- Logger : logger ,
53- Azure : janitor.JanitorAzureConfig {
54- Client : AzureClient ,
55- Subscription : Opts .Azure .Subscription ,
56- },
57- }
58- j .Init ()
59- j .Run ()
49+ go func () {
50+ j := janitor.Janitor {
51+ Conf : Opts ,
52+ UserAgent : UserAgent + gitTag ,
53+ Logger : logger ,
54+ Azure : janitor.JanitorAzureConfig {
55+ Client : AzureClient ,
56+ Subscription : Opts .Azure .Subscription ,
57+ },
58+ }
59+ j .Init ()
60+ j .Run ()
61+ }()
6062
6163 logger .Infof ("starting http server on %s" , Opts .Server .Bind )
6264 startHttpServer ()
You can’t perform that action at this time.
0 commit comments