Add test for #248, ensure objects in loops are not being reused
This commit is contained in:
parent
1042019541
commit
7f80562522
1 changed files with 13 additions and 10 deletions
|
@ -136,9 +136,8 @@ func TestArgoCDControllerServiceMonitors(t *testing.T) {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
var servicemonitor monitoringv1.ServiceMonitor
|
|
||||||
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
|
var servicemonitor monitoringv1.ServiceMonitor
|
||||||
options := &helm.Options{
|
options := &helm.Options{
|
||||||
SetValues: test.SetValues,
|
SetValues: test.SetValues,
|
||||||
KubectlOptions: k8s.NewKubectlOptions("", "", "default"),
|
KubectlOptions: k8s.NewKubectlOptions("", "", "default"),
|
||||||
|
@ -191,9 +190,8 @@ func TestArgoCDEnvironmentConfig(t *testing.T) {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
var deployment appsv1.Deployment
|
|
||||||
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
|
var deployment appsv1.Deployment
|
||||||
options := &helm.Options{
|
options := &helm.Options{
|
||||||
SetValues: test.SetValues,
|
SetValues: test.SetValues,
|
||||||
KubectlOptions: k8s.NewKubectlOptions("", "", "default"),
|
KubectlOptions: k8s.NewKubectlOptions("", "", "default"),
|
||||||
|
@ -242,9 +240,8 @@ func TestArgoCDRepoServerCustomTools(t *testing.T) {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
var deployment appsv1.Deployment
|
|
||||||
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
|
var deployment appsv1.Deployment
|
||||||
options := &helm.Options{
|
options := &helm.Options{
|
||||||
SetValues: test.SetValues,
|
SetValues: test.SetValues,
|
||||||
KubectlOptions: k8s.NewKubectlOptions("", "", "default"),
|
KubectlOptions: k8s.NewKubectlOptions("", "", "default"),
|
||||||
|
@ -301,9 +298,8 @@ func TestArgoCDControllerPrometheusRules(t *testing.T) {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
var servicemonitor monitoringv1.PrometheusRule
|
|
||||||
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
|
var servicemonitor monitoringv1.PrometheusRule
|
||||||
options := &helm.Options{
|
options := &helm.Options{
|
||||||
SetValues: test.SetValues,
|
SetValues: test.SetValues,
|
||||||
KubectlOptions: k8s.NewKubectlOptions("", "", "default"),
|
KubectlOptions: k8s.NewKubectlOptions("", "", "default"),
|
||||||
|
@ -367,11 +363,18 @@ func TestArgoCDSecurityContext(t *testing.T) {
|
||||||
"global.securityContext.runAsUser": "999",
|
"global.securityContext.runAsUser": "999",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Name: "Given a global securityContext and a dex deployment",
|
||||||
|
DeploymentYAML: []string{"templates/dex/deployment.yaml"},
|
||||||
|
SetValues: map[string]string{
|
||||||
|
"global.securityContext.runAsUser": "999",
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
var deployment appsv1.Deployment
|
|
||||||
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
|
var deployment appsv1.Deployment
|
||||||
|
|
||||||
options := &helm.Options{
|
options := &helm.Options{
|
||||||
SetValues: test.SetValues,
|
SetValues: test.SetValues,
|
||||||
KubectlOptions: k8s.NewKubectlOptions("", "", "default"),
|
KubectlOptions: k8s.NewKubectlOptions("", "", "default"),
|
||||||
|
|
Loading…
Reference in a new issue