Skip to content

Commit

Permalink
Merge branch 'main' into feature/routetable-routes
Browse files Browse the repository at this point in the history
  • Loading branch information
theunrepentantgeek authored Oct 28, 2021
2 parents 13d126e + 7720077 commit 1a32239
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 16 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/live-validation.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
name: Validate with live Azure resources
on:
push:
branches:
- main

schedule:
# chosen via a Google search for “what is the best time”
# https://www.reddit.com/r/dadjokes/comments/6dvftv/what_is_the_best_time_on_the_clock/
- cron: '30 6 * * *'
# 13:00 UTC is a time when both US and NZ are asleep (or headed in that direction)
- cron: '0 13 * * *'

jobs:
test-generator:
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/visualize-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ jobs:
uses: actions/checkout@v2
ref: bot/update-diagrams

- name: Create Branch
uses: peterjgrainger/action-create-branch@b48b0ca0e307c9b56f059b70274984ffeaa90a43 # Pinned to v2.0.1
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
with:
branch: 'bot/update-diagrams'

- name: Checkout code
uses: actions/checkout@master
with:
ref: bot/update-diagrams

- name: Update ASO v1 diagram
uses: githubocto/repo-visualizer@main
with:
Expand Down Expand Up @@ -42,11 +54,12 @@ jobs:
should_push: false

- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
uses: peter-evans/create-pull-request@7380612b49221684fefa025244f2ef4008ae50ad # v3.10.1
with:
token: ${{ secrets.GH_PAT }}
commit-message: Update Code Structure Diagrams
branch: bot/update-diagrams
base: main
delete-branch: true
title: '[Automated] Update Code Structure Diagrams'
body: |
Expand Down
23 changes: 15 additions & 8 deletions v2/internal/genericarmclient/generic_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,24 @@ type GenericClient struct {
// TODO: Need to do retryAfter detection in each call?

func NewARMConnection(creds azcore.TokenCredential, httpClient *http.Client) *arm.Connection {
opts := &arm.ConnectionOptions{
Retry: policy.RetryOptions{
MaxRetries: 0,
},
PerCallPolicies: []policy.Policy{NewUserAgentPolicy(userAgent)},
DisableRPRegistration: true,
}
// We assign this HTTPClient like this because if we actually set it to nil, due to the way
// go interfaces wrap values, the subsequent if httpClient == nil check returns false (even though
// the value IN the interface IS nil).
if httpClient != nil {
opts.HTTPClient = httpClient
}

con := arm.NewConnection(
arm.AzurePublicCloud,
creds,
&arm.ConnectionOptions{
Retry: policy.RetryOptions{
MaxRetries: 0,
},
PerCallPolicies: []policy.Policy{NewUserAgentPolicy(userAgent)},
DisableRPRegistration: true,
HTTPClient: httpClient,
})
opts)
return con
}

Expand Down

0 comments on commit 1a32239

Please sign in to comment.