Skip to content

Commit 6286ab0

Browse files
committed
apply some feedback
Signed-off-by: Jorge Turrado <[email protected]>
1 parent ce7ae4e commit 6286ab0

15 files changed

+721
-730
lines changed

config/crd/bases/http.keda.sh_clusterhttpscalingsets.yaml

Lines changed: 322 additions & 320 deletions
Large diffs are not rendered by default.

config/crd/bases/http.keda.sh_httpscalingsets.yaml

Lines changed: 320 additions & 319 deletions
Large diffs are not rendered by default.

operator/apis/http/v1alpha1/httpscalingset_defaults.go

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,123 +27,123 @@ var (
2727
scalerImage = fmt.Sprintf("ghcr.io/kedacore/http-add-on-scaler:%s", build.Version())
2828
)
2929

30-
func (c *HTTPInterceptorSepc) GetProxyPort() int32 {
30+
func (c *HTTPInterceptorSpec) GetProxyPort() int32 {
3131
if c.Config == nil || c.Config.ProxyPort == nil {
3232
return 8080
3333
}
3434
return *c.Config.ProxyPort
3535
}
3636

37-
func (c *HTTPInterceptorSepc) GetAdminPort() int32 {
37+
func (c *HTTPInterceptorSpec) GetAdminPort() int32 {
3838
if c.Config == nil || c.Config.AdminPort == nil {
3939
return 9090
4040
}
4141
return *c.Config.AdminPort
4242
}
43-
func (c *HTTPInterceptorSepc) GetConnectTimeout() string {
43+
func (c *HTTPInterceptorSpec) GetConnectTimeout() string {
4444
if c.Config == nil || c.Config.ConnectTimeout == nil {
4545
return "500ms"
4646
}
4747
return *c.Config.ConnectTimeout
4848
}
49-
func (c *HTTPInterceptorSepc) GetHeaderTimeout() string {
49+
func (c *HTTPInterceptorSpec) GetHeaderTimeout() string {
5050
if c.Config == nil || c.Config.HeaderTimeout == nil {
5151
return "500ms"
5252
}
5353
return *c.Config.HeaderTimeout
5454
}
55-
func (c *HTTPInterceptorSepc) GetWaitTimeout() string {
55+
func (c *HTTPInterceptorSpec) GetWaitTimeout() string {
5656
if c.Config == nil || c.Config.WaitTimeout == nil {
5757
return "1500ms"
5858
}
5959
return *c.Config.WaitTimeout
6060
}
61-
func (c *HTTPInterceptorSepc) GetIdleConnTimeout() string {
61+
func (c *HTTPInterceptorSpec) GetIdleConnTimeout() string {
6262
if c.Config == nil || c.Config.IdleConnTimeout == nil {
6363
return "90s"
6464
}
6565
return *c.Config.IdleConnTimeout
6666
}
67-
func (c *HTTPInterceptorSepc) GetTLSHandshakeTimeout() string {
67+
func (c *HTTPInterceptorSpec) GetTLSHandshakeTimeout() string {
6868
if c.Config == nil || c.Config.TLSHandshakeTimeout == nil {
6969
return "10s"
7070
}
7171
return *c.Config.TLSHandshakeTimeout
7272
}
73-
func (c *HTTPInterceptorSepc) GetExpectContinueTimeout() string {
73+
func (c *HTTPInterceptorSpec) GetExpectContinueTimeout() string {
7474
if c.Config == nil || c.Config.ExpectContinueTimeout == nil {
7575
return "1s"
7676
}
7777
return *c.Config.ExpectContinueTimeout
7878
}
79-
func (c *HTTPInterceptorSepc) GetForceHTTP2() bool {
79+
func (c *HTTPInterceptorSpec) GetForceHTTP2() bool {
8080
if c.Config == nil || c.Config.ForceHTTP2 == nil {
8181
return false
8282
}
8383
return *c.Config.ForceHTTP2
8484
}
85-
func (c *HTTPInterceptorSepc) GetKeepAlive() string {
85+
func (c *HTTPInterceptorSpec) GetKeepAlive() string {
8686
if c.Config == nil || c.Config.KeepAlive == nil {
8787
return "1s"
8888
}
8989
return *c.Config.KeepAlive
9090
}
91-
func (c *HTTPInterceptorSepc) GetMaxIdleConns() int {
91+
func (c *HTTPInterceptorSpec) GetMaxIdleConns() int {
9292
if c.Config == nil || c.Config.MaxIdleConns == nil {
9393
return 100
9494
}
9595
return *c.Config.MaxIdleConns
9696
}
97-
func (c *HTTPInterceptorSepc) GetPollingInterval() int {
97+
func (c *HTTPInterceptorSpec) GetPollingInterval() int {
9898
if c.Config == nil || c.Config.PollingInterval == nil {
9999
return 1000
100100
}
101101
return *c.Config.PollingInterval
102102
}
103103

104-
func (c *HTTPInterceptorSepc) GetImage() string {
104+
func (c *HTTPInterceptorSpec) GetImage() string {
105105
if c.Image == nil {
106106
return interceptorImage
107107
}
108108
return *c.Image
109109
}
110110

111-
func (c *HTTPInterceptorSepc) GetLabels() map[string]string {
111+
func (c *HTTPInterceptorSpec) GetLabels() map[string]string {
112112
if c.Labels == nil {
113113
return map[string]string{}
114114
}
115115
return c.Labels
116116
}
117117

118-
func (c *HTTPInterceptorSepc) GetAnnotations() map[string]string {
118+
func (c *HTTPInterceptorSpec) GetAnnotations() map[string]string {
119119
if c.Annotations == nil {
120120
return map[string]string{}
121121
}
122122
return c.Annotations
123123
}
124124

125-
func (c *HTTPScalerSepc) GetPort() int32 {
125+
func (c *HTTPScalerSpec) GetPort() int32 {
126126
if c.Config.Port == nil {
127127
return 9090
128128
}
129129
return *c.Config.Port
130130
}
131131

132-
func (c *HTTPScalerSepc) GetImage() string {
132+
func (c *HTTPScalerSpec) GetImage() string {
133133
if c.Image == nil {
134134
return scalerImage
135135
}
136136
return *c.Image
137137
}
138138

139-
func (c *HTTPScalerSepc) GetLabels() map[string]string {
139+
func (c *HTTPScalerSpec) GetLabels() map[string]string {
140140
if c.Labels == nil {
141141
return map[string]string{}
142142
}
143143
return c.Labels
144144
}
145145

146-
func (c *HTTPScalerSepc) GetAnnotations() map[string]string {
146+
func (c *HTTPScalerSpec) GetAnnotations() map[string]string {
147147
if c.Annotations == nil {
148148
return map[string]string{}
149149
}

operator/apis/http/v1alpha1/httpscalingset_types.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@ type HTTPInterceptorScalingSpec struct {
3737
Target int `json:"target"`
3838
}
3939

40-
// HTTPInterceptorConfigurationSepc defines the desired state of Interceptor configuration
41-
type HTTPInterceptorConfigurationSepc struct {
40+
// HTTPInterceptorConfigurationSpec defines the desired state of Interceptor configuration
41+
type HTTPInterceptorConfigurationSpec struct {
4242
// +optional
4343
// Port to be used for proxy operations
4444
ProxyPort *int32 `json:"proxyPort,omitempty"`
4545
// +optional
4646
// Port to be used for admin operations
4747
AdminPort *int32 `json:"adminPort,omitempty"`
4848
// +optional
49-
// Timeout for stablishing the connection
49+
// Timeout for establishing the connection
5050
ConnectTimeout *string `json:"connectTimeout,omitempty"`
5151
// +optional
5252
// How long to wait between when the HTTP request
@@ -86,11 +86,11 @@ type HTTPInterceptorConfigurationSepc struct {
8686
PollingInterval *int `json:"pollingInterval,omitempty"`
8787
}
8888

89-
// HTTPInterceptorSepc defines the desired state of Interceptor component
90-
type HTTPInterceptorSepc struct {
89+
// HTTPInterceptorSpec defines the desired state of Interceptor component
90+
type HTTPInterceptorSpec struct {
9191
// +optional
9292
// Traffic configuration
93-
Config *HTTPInterceptorConfigurationSepc `json:"config,omitempty"`
93+
Config *HTTPInterceptorConfigurationSpec `json:"config,omitempty"`
9494
// Number of replicas for the interceptor
9595
Replicas *int32 `json:"replicas,omitempty"`
9696
// Container image name.
@@ -126,20 +126,20 @@ type HTTPInterceptorSepc struct {
126126
ServiceAccountName string `json:"serviceAccountName"`
127127
}
128128

129-
// HTTPScalerConfigurationSepc defines the desired state of scaler configuration
130-
type HTTPScalerConfigurationSepc struct {
129+
// HTTPScalerConfigurationSpec defines the desired state of scaler configuration
130+
type HTTPScalerConfigurationSpec struct {
131131
// +kubebuilder:default=9090
132132
// +optional
133133
// Port to be used for proxy operations
134134
Port *int32 `json:"port,omitempty"`
135135
}
136136

137-
// HTTPScalerSepc defines the desired state of Scaler component
138-
type HTTPScalerSepc struct {
137+
// HTTPScalerSpec defines the desired state of Scaler component
138+
type HTTPScalerSpec struct {
139139
// +kubebuilder:default={}
140140
// +optional
141141
// Traffic configuration
142-
Config HTTPScalerConfigurationSepc `json:"config,omitempty"`
142+
Config HTTPScalerConfigurationSpec `json:"config,omitempty"`
143143
// Number of replicas for the interceptor
144144
Replicas *int32 `json:"replicas,omitempty"`
145145
// Container image name.
@@ -175,8 +175,8 @@ type HTTPScalerSepc struct {
175175

176176
// HTTPScalingSetSpec defines the desired state of HTTPScalingSet
177177
type HTTPScalingSetSpec struct {
178-
Interceptor HTTPInterceptorSepc `json:"interceptor"`
179-
Scaler HTTPScalerSepc `json:"scaler"`
178+
Interceptor HTTPInterceptorSpec `json:"interceptor"`
179+
Scaler HTTPScalerSpec `json:"scaler"`
180180
}
181181

182182
// HTTPScalingSetStatus defines the observed state of HTTPScalingSet

operator/apis/http/v1alpha1/zz_generated.deepcopy.go

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

operator/controllers/http/clusterhttpscalingset_controller.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
/*
2-
3-
42
Licensed under the Apache License, Version 2.0 (the "License");
53
you may not use this file except in compliance with the License.
64
You may obtain a copy of the License at
@@ -85,13 +83,7 @@ func (r *ClusterHTTPScalingSetReconciler) Reconcile(ctx context.Context, req ctr
8583
httpss.Namespace = r.KEDANamespace
8684

8785
// Create required app objects for the application defined by the CRD
88-
err := createOrUpdateInterceptorResources(
89-
ctx,
90-
logger,
91-
r.Client,
92-
httpss,
93-
r.Scheme,
94-
)
86+
err := createOrUpdateInterceptorResources(ctx, logger, r.Client, httpss, r.Scheme)
9587
if err != nil {
9688
return ctrl.Result{}, err
9789
}

operator/controllers/http/clusterhttpscalingset_controller_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ var _ = Describe("ClusterHTTPScalingSetController", func() {
3232
Name: name,
3333
},
3434
Spec: v1alpha1.HTTPScalingSetSpec{
35-
Interceptor: v1alpha1.HTTPInterceptorSepc{},
36-
Scaler: v1alpha1.HTTPScalerSepc{},
35+
Interceptor: v1alpha1.HTTPInterceptorSpec{},
36+
Scaler: v1alpha1.HTTPScalerSpec{},
3737
},
3838
}
3939
err := k8sClient.Create(context.Background(), css)
@@ -145,10 +145,10 @@ var _ = Describe("ClusterHTTPScalingSetController", func() {
145145
Name: name,
146146
},
147147
Spec: v1alpha1.HTTPScalingSetSpec{
148-
Interceptor: v1alpha1.HTTPInterceptorSepc{
148+
Interceptor: v1alpha1.HTTPInterceptorSpec{
149149
Replicas: ptr.To(interceptorReplicas),
150150
Resources: interceptorResouces,
151-
Config: &v1alpha1.HTTPInterceptorConfigurationSepc{
151+
Config: &v1alpha1.HTTPInterceptorConfigurationSpec{
152152
ProxyPort: ptr.To(interceptorProxyPort),
153153
AdminPort: ptr.To(interceptorAdminPort),
154154
},
@@ -159,10 +159,10 @@ var _ = Describe("ClusterHTTPScalingSetController", func() {
159159
"interceptor-annotation-1": "value-2",
160160
},
161161
},
162-
Scaler: v1alpha1.HTTPScalerSepc{
162+
Scaler: v1alpha1.HTTPScalerSpec{
163163
Replicas: ptr.To(scalerReplicas),
164164
Resources: scalerResouces,
165-
Config: v1alpha1.HTTPScalerConfigurationSepc{
165+
Config: v1alpha1.HTTPScalerConfigurationSpec{
166166
Port: ptr.To(scalerPort),
167167
},
168168
Labels: map[string]string{

operator/controllers/http/httpscalingset_controller.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
/*
2-
3-
42
Licensed under the Apache License, Version 2.0 (the "License");
53
you may not use this file except in compliance with the License.
64
You may obtain a copy of the License at
@@ -81,13 +79,7 @@ func (r *HTTPScalingSetReconciler) Reconcile(ctx context.Context, req ctrl.Reque
8179
}
8280

8381
// Create required app objects for the application defined by the CRD
84-
err := createOrUpdateInterceptorResources(
85-
ctx,
86-
logger,
87-
r.Client,
88-
httpss,
89-
r.Scheme,
90-
)
82+
err := createOrUpdateInterceptorResources(ctx, logger, r.Client, httpss, r.Scheme)
9183
if err != nil {
9284
return ctrl.Result{}, err
9385
}

0 commit comments

Comments
 (0)