Skip to content

Commit

Permalink
chore: omit replicas because nil equal to 1 by default
Browse files Browse the repository at this point in the history
Signed-off-by: Ardika Bagus <[email protected]>
  • Loading branch information
ardikabs committed Mar 8, 2024
1 parent e7f6d00 commit 545eb65
Show file tree
Hide file tree
Showing 22 changed files with 1 addition and 26 deletions.
5 changes: 1 addition & 4 deletions api/v1alpha1/validation/envoygateway_validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -668,8 +668,7 @@ func TestEnvoyGatewayProvider(t *testing.T) {

envoyGatewayProvider.Kubernetes = &v1alpha1.EnvoyGatewayKubernetesProvider{
RateLimitDeployment: &v1alpha1.KubernetesDeploymentSpec{
Replicas: nil,
Pod: nil,
Pod: nil,
Container: &v1alpha1.KubernetesContainerSpec{
Resources: nil,
SecurityContext: nil,
Expand All @@ -684,8 +683,6 @@ func TestEnvoyGatewayProvider(t *testing.T) {

assert.NotNil(t, envoyGatewayProvider.Kubernetes.RateLimitDeployment)
assert.Equal(t, envoyGatewayProvider.Kubernetes.RateLimitDeployment, v1alpha1.DefaultKubernetesDeployment(v1alpha1.DefaultRateLimitImage))
assert.NotNil(t, envoyGatewayProvider.Kubernetes.RateLimitDeployment.Replicas)
assert.Equal(t, envoyGatewayProvider.Kubernetes.RateLimitDeployment.Replicas, v1alpha1.DefaultKubernetesDeploymentReplicas())
assert.NotNil(t, envoyGatewayProvider.Kubernetes.RateLimitDeployment.Pod)
assert.Equal(t, envoyGatewayProvider.Kubernetes.RateLimitDeployment.Pod, v1alpha1.DefaultKubernetesPod())
assert.NotNil(t, envoyGatewayProvider.Kubernetes.RateLimitDeployment.Container)
Expand Down
2 changes: 0 additions & 2 deletions api/v1alpha1/validation/envoyproxy_validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -599,8 +599,6 @@ func TestEnvoyProxyProvider(t *testing.T) {

assert.NotNil(t, envoyProxyProvider.Kubernetes.EnvoyDeployment)
assert.Equal(t, envoyProxyProvider.Kubernetes.EnvoyDeployment, egv1a1.DefaultKubernetesDeployment(egv1a1.DefaultEnvoyProxyImage))
assert.NotNil(t, envoyProxyProvider.Kubernetes.EnvoyDeployment.Replicas)
assert.Equal(t, envoyProxyProvider.Kubernetes.EnvoyDeployment.Replicas, egv1a1.DefaultKubernetesDeploymentReplicas())
assert.NotNil(t, envoyProxyProvider.Kubernetes.EnvoyDeployment.Pod)
assert.Equal(t, envoyProxyProvider.Kubernetes.EnvoyDeployment.Pod, egv1a1.DefaultKubernetesPod())
assert.NotNil(t, envoyProxyProvider.Kubernetes.EnvoyDeployment.Container)
Expand Down
1 change: 0 additions & 1 deletion internal/envoygateway/config/decoder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ func TestDecode(t *testing.T) {
Type: v1alpha1.ProviderTypeKubernetes,
Kubernetes: &v1alpha1.EnvoyGatewayKubernetesProvider{
RateLimitDeployment: &v1alpha1.KubernetesDeploymentSpec{
Replicas: v1alpha1.DefaultKubernetesDeploymentReplicas(),
Strategy: v1alpha1.DefaultKubernetesDeploymentStrategy(),
Container: &v1alpha1.KubernetesContainerSpec{
Env: []corev1.EnvVar{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ provider:
type: Kubernetes
kubernetes:
rateLimitDeployment:
replicas: 1
strategy:
type: RollingUpdate
container:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ metadata:
namespace: envoy-gateway-system
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ metadata:
namespace: envoy-gateway-system
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ metadata:
namespace: envoy-gateway-system
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ metadata:
namespace: envoy-gateway-system
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ metadata:
namespace: envoy-gateway-system
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ metadata:
namespace: envoy-gateway-system
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ metadata:
namespace: envoy-gateway-system
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ metadata:
namespace: envoy-gateway-system
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ metadata:
namespace: envoy-gateway-system
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ metadata:
namespace: envoy-gateway-system
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ metadata:
namespace: envoy-gateway-system
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ metadata:
namespace: envoy-gateway-system
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ metadata:
namespace: envoy-gateway-system
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ metadata:
uid: test-owner-reference-uid-for-deployment
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ metadata:
uid: test-owner-reference-uid-for-deployment
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ metadata:
uid: test-owner-reference-uid-for-deployment
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ metadata:
uid: test-owner-reference-uid-for-deployment
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ metadata:
uid: test-owner-reference-uid-for-deployment
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
Expand Down

0 comments on commit 545eb65

Please sign in to comment.