@@ -24,23 +24,19 @@ func TestNginxProxyKubernetes(t *testing.T) {
24
24
}{
25
25
{
26
26
name : "Validate NginxProxy with both Deployment and DaemonSet is invalid" ,
27
- wantErrors : []string {"only one of deployment or daemonSet can be set" },
27
+ wantErrors : []string {expectedOneOfDeploymentOrDaemonSetError },
28
28
policySpec : ngfAPIv1alpha2.NginxProxySpec {
29
29
Kubernetes : & ngfAPIv1alpha2.KubernetesSpec {
30
- Deployment : & ngfAPIv1alpha2.DeploymentSpec {
31
- Replicas : helpers.GetPointer [int32 ](3 ),
32
- },
33
- DaemonSet : & ngfAPIv1alpha2.DaemonSetSpec {},
30
+ Deployment : & ngfAPIv1alpha2.DeploymentSpec {},
31
+ DaemonSet : & ngfAPIv1alpha2.DaemonSetSpec {},
34
32
},
35
33
},
36
34
},
37
35
{
38
36
name : "Validate NginxProxy with Deployment only is valid" ,
39
37
policySpec : ngfAPIv1alpha2.NginxProxySpec {
40
38
Kubernetes : & ngfAPIv1alpha2.KubernetesSpec {
41
- Deployment : & ngfAPIv1alpha2.DeploymentSpec {
42
- Replicas : helpers.GetPointer [int32 ](3 ),
43
- },
39
+ Deployment : & ngfAPIv1alpha2.DeploymentSpec {},
44
40
},
45
41
},
46
42
},
@@ -86,7 +82,7 @@ func TestNginxProxyRewriteClientIP(t *testing.T) {
86
82
}{
87
83
{
88
84
name : "Validate NginxProxy is invalid when trustedAddresses is not set and mode is set" ,
89
- wantErrors : []string {"if mode is set, trustedAddresses is a required field" },
85
+ wantErrors : []string {expectedIfModeSetTrustedAddressesError },
90
86
policySpec : ngfAPIv1alpha2.NginxProxySpec {
91
87
RewriteClientIP : & ngfAPIv1alpha2.RewriteClientIP {
92
88
Mode : helpers.GetPointer [ngfAPIv1alpha2.RewriteClientIPModeType ]("XForwardedFor" ),
0 commit comments