Skip to content

Commit

Permalink
Use Job ID
Browse files Browse the repository at this point in the history
  • Loading branch information
janboll committed Dec 9, 2024
1 parent 3aa3b4e commit f534033
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions tooling/templatize/internal/end2end/e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,17 @@ func newE2E(tmpdir string) e2eImpl {
}

func (e *e2eImpl) UseRandomRG() func() error {

rgSuffx := ""
if jobID := os.Getenv("GITHUB_JOB_ID"); jobID != "" {
rgSuffx = jobID
}
chars := []rune("abcdefghijklmnopqrstuvwxyz0123456789")
rg := "templatize-e2e-"

for i := 0; i < 10; i++ {
rg += string(chars[rand.IntN(len(chars))])
for i := 0; i < 3; i++ {
rgSuffx += string(chars[rand.IntN(len(chars))])
}
e.rgName = rg
e.SetConfig(config.Variables{"defaults": config.Variables{"rg": rg}})

e.rgName = "templatize-e2e-" + rgSuffx
e.SetConfig(config.Variables{"defaults": config.Variables{"rg": e.rgName}})

return func() error {
subsriptionID, err := pipeline.LookupSubscriptionID(context.Background(), "ARO Hosted Control Planes (EA Subscription 1)")
Expand Down

0 comments on commit f534033

Please sign in to comment.