-
Notifications
You must be signed in to change notification settings - Fork 7k
feat(appset): parameterize requeue time #20063 #20064
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
f4d8794
24a3b99
397b28f
ced5efa
f98380e
0a008bb
ac506fb
fb1e054
6a9764b
4532465
1682e4f
81ba733
79a6dc5
fb8c630
5260b55
a6942f5
a7798b5
43442d5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| package generators | ||
|
|
||
| import ( | ||
| "testing" | ||
| "time" | ||
|
|
||
| "github.com/stretchr/testify/assert" | ||
| ) | ||
|
|
||
| func Test_getDefaultRequeueAfter(t *testing.T) { | ||
| tests := []struct { | ||
| name string | ||
| requeueAfterEnv string | ||
| want time.Duration | ||
| }{ | ||
| {name: "Default", requeueAfterEnv: "", want: DefaultRequeueAfterSeconds}, | ||
| {name: "Min", requeueAfterEnv: "1s", want: 1 * time.Second}, | ||
| {name: "Max", requeueAfterEnv: "8760h", want: 8760 * time.Hour}, | ||
| {name: "Override", requeueAfterEnv: "10m", want: 10 * time.Minute}, | ||
| {name: "LessThanMin", requeueAfterEnv: "1ms", want: DefaultRequeueAfterSeconds}, | ||
| {name: "MoreThanMax", requeueAfterEnv: "8761h", want: DefaultRequeueAfterSeconds}, | ||
| } | ||
| for _, tt := range tests { | ||
| t.Run(tt.name, func(t *testing.T) { | ||
| t.Setenv("ARGOCD_APPLICATIONSET_CONTROLLER_REQUEUE_AFTER", tt.requeueAfterEnv) | ||
| assert.Equalf(t, tt.want, getDefaultRequeueAfter(), "getDefaultRequeueAfter()") | ||
| }) | ||
| } | ||
| } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.