Skip to content

Commit f047723

Browse files
committed
[chore]: fix deprecatedComment issues from gocritic
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
1 parent a0187d0 commit f047723

File tree

6 files changed

+66
-4
lines changed

6 files changed

+66
-4
lines changed

.golangci.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,40 @@ linters:
1919
desc: Use 'errors.Join' instead of go.uber.org/multierr
2020
exhaustive:
2121
default-signifies-exhaustive: true
22+
gocritic:
23+
disabled-checks:
24+
- appendAssign
25+
- appendCombine
26+
- argOrder
27+
- assignOp
28+
- builtinShadow
29+
- commentedOutCode
30+
- deferInLoop
31+
- elseif
32+
- emptyFallthrough
33+
- emptyStringTest
34+
- exitAfterDefer
35+
- filepathJoin
36+
- httpNoBody
37+
- hugeParam
38+
- ifElseChain
39+
- importShadow
40+
- nestingReduce
41+
- octalLiteral
42+
- offBy1
43+
- paramTypeCombine
44+
- rangeValCopy
45+
- redundantSprint
46+
- regexpMust
47+
- regexpSimplify
48+
- sloppyReassign
49+
- stringXbytes
50+
- typeDefFirst
51+
- typeSwitchVar
52+
- unlambda
53+
- unnamedResult
54+
- whyNoLint
55+
enable-all: true
2256
goheader:
2357
template: |-
2458
Copyright The OpenTelemetry Authors
@@ -144,6 +178,7 @@ linters:
144178
- errcheck
145179
- errorlint
146180
- exhaustive
181+
- gocritic
147182
- godot
148183
- goheader
149184
- gosec
@@ -167,6 +202,9 @@ linters:
167202
- legacy
168203
- std-error-handling
169204
rules:
205+
- linters:
206+
- staticcheck
207+
text: ".*.VolumeSizeLimit is deprecated:"
170208
- linters:
171209
- gosec
172210
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: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ import (
1010
"github.com/open-telemetry/opentelemetry-operator/apis/v1beta1"
1111
)
1212

13-
// Deprecated use upgradeFuncV1beta1.
14-
type upgradeFunc func(u VersionUpgrade, otelcol *v1alpha1.OpenTelemetryCollector) (*v1alpha1.OpenTelemetryCollector, error)
15-
type upgradeFuncV1beta1 func(u VersionUpgrade, otelcol *v1beta1.OpenTelemetryCollector) (*v1beta1.OpenTelemetryCollector, error)
13+
type (
14+
// Deprecated: use upgradeFuncV1beta1.
15+
upgradeFunc func(u VersionUpgrade, otelcol *v1alpha1.OpenTelemetryCollector) (*v1alpha1.OpenTelemetryCollector, error)
16+
upgradeFuncV1beta1 func(u VersionUpgrade, otelcol *v1beta1.OpenTelemetryCollector) (*v1beta1.OpenTelemetryCollector, error)
17+
)
1618

1719
type otelcolVersion struct {
18-
// deprecated use upgradeV1beta1.
20+
// Deprecated: use upgradeV1beta1.
1921
upgrade upgradeFunc
2022
upgradeV1beta1 upgradeFuncV1beta1
2123
semver.Version

0 commit comments

Comments
 (0)