-
Notifications
You must be signed in to change notification settings - Fork 839
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
Set exec timeout repo branch #1650
base: master
Are you sure you want to change the base?
Changes from 3 commits
0866a5d
8f6f636
798ddb5
9490d55
3038f5b
5308b55
283c9c0
5afcc05
4b25473
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -295,8 +295,8 @@ func TestReconcileArgoCD_reconcile_ServerDeployment_env(t *testing.T) { | |
Value: "FOO", | ||
}, | ||
} | ||
timeout := 600 | ||
a.Spec.Repo.ExecTimeout = &timeout | ||
timeout := "600" | ||
a.Spec.Repo.ExecTimeout = timeout | ||
|
||
resObjs := []client.Object{a} | ||
subresObjs := []client.Object{a} | ||
|
@@ -336,8 +336,8 @@ func TestReconcileArgoCD_reconcileRepoDeployment_env(t *testing.T) { | |
Value: "FOO", | ||
}, | ||
} | ||
timeout := 600 | ||
a.Spec.Repo.ExecTimeout = &timeout | ||
timeout := "600m" | ||
a.Spec.Repo.ExecTimeout = timeout | ||
|
||
resObjs := []client.Object{a} | ||
subresObjs := []client.Object{a} | ||
|
@@ -359,14 +359,14 @@ func TestReconcileArgoCD_reconcileRepoDeployment_env(t *testing.T) { | |
assert.Len(t, deployment.Spec.Template.Spec.Containers[0].Env, 4) | ||
assert.Contains(t, deployment.Spec.Template.Spec.Containers[0].Env, corev1.EnvVar{Name: "FOO", Value: "BAR"}) | ||
assert.Contains(t, deployment.Spec.Template.Spec.Containers[0].Env, corev1.EnvVar{Name: "BAR", Value: "FOO"}) | ||
assert.Contains(t, deployment.Spec.Template.Spec.Containers[0].Env, corev1.EnvVar{Name: "ARGOCD_EXEC_TIMEOUT", Value: "600s"}) | ||
assert.Contains(t, deployment.Spec.Template.Spec.Containers[0].Env, corev1.EnvVar{Name: "ARGOCD_EXEC_TIMEOUT", Value: "600m"}) | ||
}) | ||
|
||
t.Run("ExecTimeout set", func(t *testing.T) { | ||
logf.SetLogger(ZapLogger(true)) | ||
a := makeTestArgoCD() | ||
timeout := 600 | ||
a.Spec.Repo.ExecTimeout = &timeout | ||
timeout := "600m" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should it not be |
||
a.Spec.Repo.ExecTimeout = timeout | ||
|
||
resObjs := []client.Object{a} | ||
subresObjs := []client.Object{a} | ||
|
@@ -386,14 +386,14 @@ func TestReconcileArgoCD_reconcileRepoDeployment_env(t *testing.T) { | |
|
||
// Check that the env vars are set, Count is 2 because of the default REDIS_PASSWORD env var | ||
assert.Len(t, deployment.Spec.Template.Spec.Containers[0].Env, 2) | ||
assert.Contains(t, deployment.Spec.Template.Spec.Containers[0].Env, corev1.EnvVar{Name: "ARGOCD_EXEC_TIMEOUT", Value: "600s"}) | ||
assert.Contains(t, deployment.Spec.Template.Spec.Containers[0].Env, corev1.EnvVar{Name: "ARGOCD_EXEC_TIMEOUT", Value: "600m"}) | ||
}) | ||
|
||
t.Run("ExecTimeout set with env set explicitly", func(t *testing.T) { | ||
logf.SetLogger(ZapLogger(true)) | ||
a := makeTestArgoCD() | ||
timeout := 600 | ||
a.Spec.Repo.ExecTimeout = &timeout | ||
timeout := "600m" | ||
a.Spec.Repo.ExecTimeout = timeout | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can do a direct assignment |
||
a.Spec.Repo.Env = []corev1.EnvVar{ | ||
{ | ||
Name: "ARGOCD_EXEC_TIMEOUT", | ||
|
@@ -419,7 +419,7 @@ func TestReconcileArgoCD_reconcileRepoDeployment_env(t *testing.T) { | |
|
||
// Check that the env vars are set, Count is 2 because of the default REDIS_PASSWORD env var | ||
assert.Len(t, deployment.Spec.Template.Spec.Containers[0].Env, 2) | ||
assert.Contains(t, deployment.Spec.Template.Spec.Containers[0].Env, corev1.EnvVar{Name: "ARGOCD_EXEC_TIMEOUT", Value: "600s"}) | ||
assert.Contains(t, deployment.Spec.Template.Spec.Containers[0].Env, corev1.EnvVar{Name: "ARGOCD_EXEC_TIMEOUT", Value: "600m"}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's keep the same value as |
||
}) | ||
t.Run("ExecTimeout not set", func(t *testing.T) { | ||
logf.SetLogger(ZapLogger(true)) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1672,7 +1672,7 @@ spec: | |
type: object | ||
type: array | ||
execTimeout: | ||
description: ExecTimeout specifies the timeout in seconds for | ||
description: ExecTimeout specifies the timeout in minutes for | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It can be seconds, minutes or hours based on the suffix user provides. This description needs a change. |
||
tool execution | ||
type: integer | ||
extraRepoCommandArgs: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ metadata: | |
name: argocd | ||
spec: | ||
repo: | ||
execTimeout: 300 | ||
execTimeout: 300s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For including the validation, let's define an alias for
string
calledDuration
Detailed example can be found here. https://github.com/prometheus-operator/prometheus-operator/blob/dff3575c55ee9e6423907e4bfdcb5ac4b8fe9c89/pkg/apis/monitoring/v1/types.go#L45