@@ -24,23 +24,19 @@ func TestNginxProxyKubernetes(t *testing.T) {
2424 }{
2525 {
2626 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 },
2828 policySpec : ngfAPIv1alpha2.NginxProxySpec {
2929 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 {},
3432 },
3533 },
3634 },
3735 {
3836 name : "Validate NginxProxy with Deployment only is valid" ,
3937 policySpec : ngfAPIv1alpha2.NginxProxySpec {
4038 Kubernetes : & ngfAPIv1alpha2.KubernetesSpec {
41- Deployment : & ngfAPIv1alpha2.DeploymentSpec {
42- Replicas : helpers.GetPointer [int32 ](3 ),
43- },
39+ Deployment : & ngfAPIv1alpha2.DeploymentSpec {},
4440 },
4541 },
4642 },
@@ -86,7 +82,7 @@ func TestNginxProxyRewriteClientIP(t *testing.T) {
8682 }{
8783 {
8884 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 },
9086 policySpec : ngfAPIv1alpha2.NginxProxySpec {
9187 RewriteClientIP : & ngfAPIv1alpha2.RewriteClientIP {
9288 Mode : helpers.GetPointer [ngfAPIv1alpha2.RewriteClientIPModeType ]("XForwardedFor" ),
0 commit comments