Skip to content

Commit e17e0de

Browse files
authored
[chore]: fix deprecatedComment issues from gocritic (#4813)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
1 parent 79e7de1 commit e17e0de

File tree

6 files changed

+27
-3
lines changed

6 files changed

+27
-3
lines changed

.golangci.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ linters:
2828
- builtinShadow
2929
- commentedOutCode
3030
- deferInLoop
31-
- deprecatedComment
3231
- elseif
3332
- emptyFallthrough
3433
- emptyStringTest
@@ -202,6 +201,9 @@ linters:
202201
- legacy
203202
- std-error-handling
204203
rules:
204+
- linters:
205+
- staticcheck
206+
text: ".*.VolumeSizeLimit is deprecated:"
205207
- linters:
206208
- gosec
207209
path: _test\.go

apis/v1alpha1/instrumentation_types.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ type Java struct {
163163

164164
// VolumeSizeLimit defines size limit for volume used for auto-instrumentation.
165165
// The default size is 200Mi.
166+
//
166167
// Deprecated: use spec.<lang>.volume.size instead. This field will be inactive in a future release.
167168
VolumeSizeLimit *resource.Quantity `json:"volumeLimitSize,omitempty"`
168169

@@ -202,6 +203,7 @@ type NodeJS struct {
202203

203204
// VolumeSizeLimit defines size limit for volume used for auto-instrumentation.
204205
// The default size is 200Mi.
206+
//
205207
// Deprecated: use spec.<lang>.volume.size instead. This field will be inactive in a future release.
206208
VolumeSizeLimit *resource.Quantity `json:"volumeLimitSize,omitempty"`
207209

@@ -228,6 +230,7 @@ type Python struct {
228230

229231
// VolumeSizeLimit defines size limit for volume used for auto-instrumentation.
230232
// The default size is 200Mi.
233+
//
231234
// Deprecated: use spec.<lang>.volume.size instead. This field will be inactive in a future release.
232235
VolumeSizeLimit *resource.Quantity `json:"volumeLimitSize,omitempty"`
233236

@@ -254,6 +257,7 @@ type DotNet struct {
254257

255258
// VolumeSizeLimit defines size limit for volume used for auto-instrumentation.
256259
// The default size is 200Mi.
260+
//
257261
// Deprecated: use spec.<lang>.volume.size instead. This field will be inactive in a future release.
258262
VolumeSizeLimit *resource.Quantity `json:"volumeLimitSize,omitempty"`
259263

@@ -278,6 +282,7 @@ type Go struct {
278282

279283
// VolumeSizeLimit defines size limit for volume used for auto-instrumentation.
280284
// The default size is 200Mi.
285+
//
281286
// Deprecated: use spec.<lang>.volume.size instead. This field will be inactive in a future release.
282287
VolumeSizeLimit *resource.Quantity `json:"volumeLimitSize,omitempty"`
283288

@@ -304,6 +309,7 @@ type ApacheHttpd struct {
304309

305310
// VolumeSizeLimit defines size limit for volume used for auto-instrumentation.
306311
// The default size is 200Mi.
312+
//
307313
// Deprecated: use spec.<lang>.volume.size instead. This field will be inactive in a future release.
308314
VolumeSizeLimit *resource.Quantity `json:"volumeLimitSize,omitempty"`
309315

@@ -345,6 +351,7 @@ type Nginx struct {
345351

346352
// VolumeSizeLimit defines size limit for volume used for auto-instrumentation.
347353
// The default size is 200Mi.
354+
//
348355
// Deprecated: use spec.<lang>.volume.size instead. This field will be inactive in a future release.
349356
VolumeSizeLimit *resource.Quantity `json:"volumeLimitSize,omitempty"`
350357

apis/v1alpha1/opentelemetrycollector_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,12 @@ type OpenTelemetryCollectorSpec struct {
106106
Replicas *int32 `json:"replicas,omitempty"`
107107
// MinReplicas sets a lower bound to the autoscaling feature. Set this if you are using autoscaling. It must be at least 1
108108
// +optional
109+
//
109110
// Deprecated: use "OpenTelemetryCollector.Spec.Autoscaler.MinReplicas" instead.
110111
MinReplicas *int32 `json:"minReplicas,omitempty"`
111112
// MaxReplicas sets an upper bound to the autoscaling feature. If MaxReplicas is set autoscaling is enabled.
112113
// +optional
114+
//
113115
// Deprecated: use "OpenTelemetryCollector.Spec.Autoscaler.MaxReplicas" instead.
114116
MaxReplicas *int32 `json:"maxReplicas,omitempty"`
115117
// Autoscaler specifies the pod autoscaling configuration to use
@@ -448,11 +450,13 @@ type OpenTelemetryCollectorStatus struct {
448450
// Messages about actions performed by the operator on this resource.
449451
// +optional
450452
// +listType=atomic
453+
//
451454
// Deprecated: use Kubernetes events instead.
452455
Messages []string `json:"messages,omitempty"`
453456

454457
// Replicas is currently not being set and might be removed in the next version.
455458
// +optional
459+
//
456460
// Deprecated: use "OpenTelemetryCollector.Status.Scale.Replicas" instead.
457461
Replicas int32 `json:"replicas,omitempty"`
458462
}

docs/api/instrumentations.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ If omitted, an emptyDir is used with size limit VolumeSizeLimit<br/>
271271
<td>
272272
VolumeSizeLimit defines size limit for volume used for auto-instrumentation.
273273
The default size is 200Mi.
274+
274275
Deprecated: use spec.<lang>.volume.size instead. This field will be inactive in a future release.<br/>
275276
</td>
276277
<td>false</td>
@@ -1591,6 +1592,7 @@ If omitted, an emptyDir is used with size limit VolumeSizeLimit<br/>
15911592
<td>
15921593
VolumeSizeLimit defines size limit for volume used for auto-instrumentation.
15931594
The default size is 200Mi.
1595+
15941596
Deprecated: use spec.<lang>.volume.size instead. This field will be inactive in a future release.<br/>
15951597
</td>
15961598
<td>false</td>
@@ -2983,6 +2985,7 @@ If omitted, an emptyDir is used with size limit VolumeSizeLimit<br/>
29832985
<td>
29842986
VolumeSizeLimit defines size limit for volume used for auto-instrumentation.
29852987
The default size is 200Mi.
2988+
29862989
Deprecated: use spec.<lang>.volume.size instead. This field will be inactive in a future release.<br/>
29872990
</td>
29882991
<td>false</td>
@@ -3941,6 +3944,7 @@ If omitted, an emptyDir is used with size limit VolumeSizeLimit<br/>
39413944
<td>
39423945
VolumeSizeLimit defines size limit for volume used for auto-instrumentation.
39433946
The default size is 200Mi.
3947+
39443948
Deprecated: use spec.<lang>.volume.size instead. This field will be inactive in a future release.<br/>
39453949
</td>
39463950
<td>false</td>
@@ -4942,6 +4946,7 @@ If omitted, an emptyDir is used with size limit VolumeSizeLimit<br/>
49424946
<td>
49434947
VolumeSizeLimit defines size limit for volume used for auto-instrumentation.
49444948
The default size is 200Mi.
4949+
49454950
Deprecated: use spec.<lang>.volume.size instead. This field will be inactive in a future release.<br/>
49464951
</td>
49474952
<td>false</td>
@@ -6231,6 +6236,7 @@ If omitted, an emptyDir is used with size limit VolumeSizeLimit<br/>
62316236
<td>
62326237
VolumeSizeLimit defines size limit for volume used for auto-instrumentation.
62336238
The default size is 200Mi.
6239+
62346240
Deprecated: use spec.<lang>.volume.size instead. This field will be inactive in a future release.<br/>
62356241
</td>
62366242
<td>false</td>
@@ -7181,6 +7187,7 @@ If omitted, an emptyDir is used with size limit VolumeSizeLimit<br/>
71817187
<td>
71827188
VolumeSizeLimit defines size limit for volume used for auto-instrumentation.
71837189
The default size is 200Mi.
7190+
71847191
Deprecated: use spec.<lang>.volume.size instead. This field will be inactive in a future release.<br/>
71857192
</td>
71867193
<td>false</td>

docs/api/opentelemetrycollectors.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ It is only effective when healthcheckextension is configured in the OpenTelemetr
237237
<td>integer</td>
238238
<td>
239239
MaxReplicas sets an upper bound to the autoscaling feature. If MaxReplicas is set autoscaling is enabled.
240+
240241
Deprecated: use "OpenTelemetryCollector.Spec.Autoscaler.MaxReplicas" instead.<br/>
241242
<br/>
242243
<i>Format</i>: int32<br/>
@@ -247,6 +248,7 @@ Deprecated: use "OpenTelemetryCollector.Spec.Autoscaler.MaxReplicas" instead.<br
247248
<td>integer</td>
248249
<td>
249250
MinReplicas sets a lower bound to the autoscaling feature. Set this if you are using autoscaling. It must be at least 1
251+
250252
Deprecated: use "OpenTelemetryCollector.Spec.Autoscaler.MinReplicas" instead.<br/>
251253
<br/>
252254
<i>Format</i>: int32<br/>
@@ -19955,6 +19957,7 @@ OpenTelemetryCollectorStatus defines the observed state of OpenTelemetryCollecto
1995519957
<td>[]string</td>
1995619958
<td>
1995719959
Messages about actions performed by the operator on this resource.
19960+
1995819961
Deprecated: use Kubernetes events instead.<br/>
1995919962
</td>
1996019963
<td>false</td>
@@ -19963,6 +19966,7 @@ Deprecated: use Kubernetes events instead.<br/>
1996319966
<td>integer</td>
1996419967
<td>
1996519968
Replicas is currently not being set and might be removed in the next version.
19969+
1996619970
Deprecated: use "OpenTelemetryCollector.Status.Scale.Replicas" instead.<br/>
1996719971
<br/>
1996819972
<i>Format</i>: int32<br/>

pkg/collector/upgrade/versions.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ import (
1111
)
1212

1313
type (
14-
// Deprecated use upgradeFuncV1beta1.
14+
// Deprecated: use upgradeFuncV1beta1.
1515
upgradeFunc func(u VersionUpgrade, otelcol *v1alpha1.OpenTelemetryCollector) (*v1alpha1.OpenTelemetryCollector, error)
1616
upgradeFuncV1beta1 func(u VersionUpgrade, otelcol *v1beta1.OpenTelemetryCollector) (*v1beta1.OpenTelemetryCollector, error)
1717
)
1818

1919
type otelcolVersion struct {
20-
// deprecated use upgradeV1beta1.
20+
// Deprecated: use upgradeV1beta1.
2121
upgrade upgradeFunc
2222
upgradeV1beta1 upgradeFuncV1beta1
2323
semver.Version

0 commit comments

Comments
 (0)