Skip to content

Commit

Permalink
fixing
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Volchok <alex.volchok@sap.com>
  • Loading branch information
alexwo committed Apr 3, 2024
1 parent 99bc62a commit 7ce2929
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 16 deletions.
2 changes: 1 addition & 1 deletion api/v1alpha1/envoygateway_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ func (e *EnvoyGateway) NamespaceMode() bool {
// DefaultLeaderElection returns a new LeaderElection with default configuration parameters.
func DefaultLeaderElection() *LeaderElection {
return &LeaderElection{
LeaseDuration: ptr.To(time.Second * 15),
RenewDeadline: ptr.To(time.Second * 10),
RetryPeriod: ptr.To(time.Second * 2),
LeaseDuration: ptr.To(time.Second * 15),
Disabled: ptr.To(false),
}
}
Expand Down
1 change: 1 addition & 0 deletions api/v1alpha1/validation/envoygateway_validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,7 @@ func TestEnvoyGatewayProvider(t *testing.T) {
assert.NotNil(t, envoyGateway.Provider)

envoyGatewayProvider := envoyGateway.GetEnvoyGatewayProvider()
assert.Nil(t, envoyGatewayProvider.Kubernetes)
assert.Equal(t, envoyGateway.Provider, envoyGatewayProvider)

envoyGatewayProvider.Kubernetes = v1alpha1.DefaultEnvoyGatewayKubeProvider()
Expand Down
10 changes: 5 additions & 5 deletions charts/gateway-helm/values.tmpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ deployment:
repository: ${ImageRepository}
tag: '${ImageTag}'
imagePullPolicy: Always
imagePullSecrets: [ ]
imagePullSecrets: []
resources:
limits:
cpu: 500m
Expand Down Expand Up @@ -46,9 +46,9 @@ kubernetesClusterDomain: cluster.local

certgen:
job:
annotations: { }
resources: { }
annotations: {}
resources: {}
ttlSecondsAfterFinished: 0
rbac:
annotations: { }
labels: { }
annotations: {}
labels: {}
6 changes: 1 addition & 5 deletions internal/envoygateway/config/decoder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ package config
import (
"reflect"
"testing"
"time"

"github.com/stretchr/testify/require"
corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -336,10 +335,7 @@ func TestDecode(t *testing.T) {
Type: v1alpha1.ProviderTypeKubernetes,
Kubernetes: &v1alpha1.EnvoyGatewayKubernetesProvider{
LeaderElection: &v1alpha1.LeaderElection{
Disabled: ptr.To(true),
RetryPeriod: ptr.To(time.Second),
RenewDeadline: ptr.To(time.Second * 2),
LeaseDuration: ptr.To(time.Second * 3),
Disabled: ptr.To(true),
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,4 @@ provider:
type: Kubernetes
kubernetes:
leaderElection:
disabled: true
retryPeriod: 1s
renewDeadline: 2s
leaseDuration: 3s
disabled: true

Check failure on line 9 in internal/envoygateway/config/testdata/decoder/in/gateway-leaderelection.yaml

View workflow job for this annotation

GitHub Actions / lint

9:21 [new-line-at-end-of-file] no new line character at the end of file

Check failure on line 9 in internal/envoygateway/config/testdata/decoder/in/gateway-leaderelection.yaml

View workflow job for this annotation

GitHub Actions / lint

9:21 [new-line-at-end-of-file] no new line character at the end of file
2 changes: 1 addition & 1 deletion site/content/en/latest/api/extension_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -1686,7 +1686,7 @@ _Appears in:_
| --- | --- | --- | --- |
| `leaseDuration` | _[Duration](#duration)_ | true | LeaseDuration defines the time non-leader contenders will wait before attempting to claim leadership. It's based on the timestamp of the last acknowledged signal. The default setting is 15 seconds.<br />Default is 15 seconds. |
| `renewDeadline` | _[Duration](#duration)_ | true | RenewDeadline represents the time frame within which the current leader will attempt to renew its leadership status before relinquishing its position. The default setting is 10 seconds.<br />Default is 10 seconds. |
| `retryPeriod` | _[Duration](#duration)_ | true | RetryPeriod denotes the interval at which LeaderElector clients should perform action retries. The default setting is 2 seconds.<br />Default is 15 seconds. |
| `retryPeriod` | _[Duration](#duration)_ | true | RetryPeriod denotes the interval at which LeaderElector clients should perform action retries. The default setting is 2 seconds.<br />Default is 2 seconds. |
| `disabled` | _boolean_ | true | Disabled allows to disable leader election (enabled by default) |


Expand Down

0 comments on commit 7ce2929

Please sign in to comment.