Skip to content

Commit

Permalink
fixup! fix: Default value of qps and burst
Browse files Browse the repository at this point in the history
Signed-off-by: Mateus Oliveira <[email protected]>
  • Loading branch information
mateusoliveira43 committed Jul 31, 2024
1 parent aa998ac commit 8a0732c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 25 deletions.
4 changes: 2 additions & 2 deletions api/v1alpha1/oadp_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ type VeleroConfig struct {
// Default is 10m
// +optional
ResourceTimeout string `json:"resourceTimeout,omitempty"`
// Maximum number of requests by the server to the Kubernetes API in a short period of time. (default 100)
// maximum number of requests by the server to the Kubernetes API in a short period of time. (default 100)
// +optional
ClientBurst *int `json:"client-burst,omitempty"`
// Maximum number of requests per second by the server to the Kubernetes API once the burst limit has been reached. (default 100)
// maximum number of requests per second by the server to the Kubernetes API once the burst limit has been reached. (default 100)
// +optional
ClientQPS *int `json:"client-qps,omitempty"`
// Velero args are settings to customize velero server arguments. Overrides values in other fields.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -799,10 +799,10 @@ spec:
type: string
type: object
client-burst:
description: Maximum number of requests by the server to the Kubernetes API in a short period of time. (default 100)
description: maximum number of requests by the server to the Kubernetes API in a short period of time. (default 100)
type: integer
client-qps:
description: Maximum number of requests per second by the server to the Kubernetes API once the burst limit has been reached. (default 100)
description: maximum number of requests per second by the server to the Kubernetes API once the burst limit has been reached. (default 100)
type: integer
customPlugins:
description: customPlugins defines the custom plugin to be installed with Velero
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -799,10 +799,10 @@ spec:
type: string
type: object
client-burst:
description: Maximum number of requests by the server to the Kubernetes API in a short period of time. (default 100)
description: maximum number of requests by the server to the Kubernetes API in a short period of time. (default 100)
type: integer
client-qps:
description: Maximum number of requests per second by the server to the Kubernetes API once the burst limit has been reached. (default 100)
description: maximum number of requests per second by the server to the Kubernetes API once the burst limit has been reached. (default 100)
type: integer
customPlugins:
description: customPlugins defines the custom plugin to be installed with Velero
Expand Down
37 changes: 18 additions & 19 deletions controllers/velero_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4561,15 +4561,6 @@ func TestDPAReconciler_buildVeleroDeployment(t *testing.T) {
},
{
name: "Override burst and qps",
veleroDeployment: &appsv1.Deployment{
ObjectMeta: metav1.ObjectMeta{
Name: "test-velero-deployment",
Namespace: "test-ns",
},
Spec: appsv1.DeploymentSpec{
Selector: &metav1.LabelSelector{MatchLabels: veleroDeploymentMatchLabels},
},
},
dpa: &oadpv1alpha1.DataProtectionApplication{
ObjectMeta: metav1.ObjectMeta{
Name: "test-Velero-CR",
Expand All @@ -4587,6 +4578,15 @@ func TestDPAReconciler_buildVeleroDeployment(t *testing.T) {
},
},
},
veleroDeployment: &appsv1.Deployment{
ObjectMeta: metav1.ObjectMeta{
Name: "test-velero-deployment",
Namespace: "test-ns",
},
Spec: appsv1.DeploymentSpec{
Selector: &metav1.LabelSelector{MatchLabels: veleroDeploymentMatchLabels},
},
},
wantVeleroDeployment: &appsv1.Deployment{
ObjectMeta: metav1.ObjectMeta{
Name: "test-velero-deployment",
Expand Down Expand Up @@ -4635,15 +4635,6 @@ func TestDPAReconciler_buildVeleroDeployment(t *testing.T) {
},
{
name: "Conflicting burst and qps",
veleroDeployment: &appsv1.Deployment{
ObjectMeta: metav1.ObjectMeta{
Name: "test-velero-deployment",
Namespace: "test-ns",
},
Spec: appsv1.DeploymentSpec{
Selector: &metav1.LabelSelector{MatchLabels: veleroDeploymentMatchLabels},
},
},
dpa: &oadpv1alpha1.DataProtectionApplication{
ObjectMeta: metav1.ObjectMeta{
Name: "test-Velero-CR",
Expand All @@ -4667,6 +4658,15 @@ func TestDPAReconciler_buildVeleroDeployment(t *testing.T) {
},
},
},
veleroDeployment: &appsv1.Deployment{
ObjectMeta: metav1.ObjectMeta{
Name: "test-velero-deployment",
Namespace: "test-ns",
},
Spec: appsv1.DeploymentSpec{
Selector: &metav1.LabelSelector{MatchLabels: veleroDeploymentMatchLabels},
},
},
wantVeleroDeployment: &appsv1.Deployment{
ObjectMeta: metav1.ObjectMeta{
Name: "test-velero-deployment",
Expand Down Expand Up @@ -4712,7 +4712,6 @@ func TestDPAReconciler_buildVeleroDeployment(t *testing.T) {
},
},
},
wantErr: true, // TODO should error to avoid user confusion?
},
}
for _, tt := range tests {
Expand Down

0 comments on commit 8a0732c

Please sign in to comment.