Skip to content

Commit d0adab7

Browse files
authored
[chore]: Deprecated VolumeSizeLimit in the Instrumentation CRD (#4431)
* fix: deprecate volumeSizeLimit field in instrumentation types * feat: add deprecation warnings for volumeSizeLimit field in instrumentation spec * chore: Regenerated bundle and manifests * fix: minor changes * fix: updates related to changelog * bug: Revert rename of volumeLimitSize * chore: Regenerated bundle and manifests
1 parent 7bb0eff commit d0adab7

File tree

7 files changed

+126
-9
lines changed

7 files changed

+126
-9
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
2+
change_type: deprecation
3+
4+
# The name of the component, or a single word describing the area of concern, (e.g. collector, target allocator, auto-instrumentation, opamp, github action)
5+
component: auto-instrumentation
6+
7+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
8+
note: Deprecate VolumeSizeLimit in the Instrumentation CRD
9+
10+
# One or more tracking issues related to the change
11+
issues: [3382]
12+
13+
# (Optional) One or more lines of additional information to render under the primary note.
14+
# These lines will be padded with 2 spaces and then inserted directly into the document.
15+
# Use pipe (|) for multiline entries.
16+
subtext: |
17+
- The `volumeSizeLimit` field is deprecated.
18+
- Use `spec.<lang>.volume.size` instead of `spec.<lang>.volumeSizeLimit`.
19+
- The validating webhook emits a warning when `volumeSizeLimit` is used.

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+
// Deprecated: use spec.<lang>.volume.size instead. This field will be inactive in a future release.
166167
VolumeSizeLimit *resource.Quantity `json:"volumeLimitSize,omitempty"`
167168

168169
// Env defines java specific env vars. There are four layers for env vars' definitions and
@@ -201,6 +202,7 @@ type NodeJS struct {
201202

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

206208
// Env defines nodejs specific env vars. There are four layers for env vars' definitions and
@@ -226,6 +228,7 @@ type Python struct {
226228

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

231234
// Env defines python specific env vars. There are four layers for env vars' definitions and
@@ -251,6 +254,7 @@ type DotNet struct {
251254

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

256260
// Env defines DotNet specific env vars. There are four layers for env vars' definitions and
@@ -274,6 +278,7 @@ type Go struct {
274278

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

279284
// Env defines Go specific env vars. There are four layers for env vars' definitions and
@@ -299,6 +304,7 @@ type ApacheHttpd struct {
299304

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

304310
// Env defines Apache HTTPD specific env vars. There are four layers for env vars' definitions and
@@ -339,6 +345,7 @@ type Nginx struct {
339345

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

344351
// Env defines Nginx specific env vars. There are four layers for env vars' definitions and

apis/v1alpha1/instrumentation_webhook.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,29 @@ func (w InstrumentationWebhook) validate(r *Instrumentation) (admission.Warnings
259259

260260
warnings = append(warnings, validateExporter(r.Spec.Exporter)...)
261261

262+
// Deprecated field warnings: spec.<lang>.volumeSizeLimit
263+
if r.Spec.Java.VolumeSizeLimit != nil {
264+
warnings = append(warnings, "spec.java.volumeSizeLimit is deprecated and will be removed in a future release; use spec.java.volume.size instead")
265+
}
266+
if r.Spec.NodeJS.VolumeSizeLimit != nil {
267+
warnings = append(warnings, "spec.nodejs.volumeSizeLimit is deprecated and will be removed in a future release; use spec.nodejs.volume.size instead")
268+
}
269+
if r.Spec.Python.VolumeSizeLimit != nil {
270+
warnings = append(warnings, "spec.python.volumeSizeLimit is deprecated and will be removed in a future release; use spec.python.volume.size instead")
271+
}
272+
if r.Spec.DotNet.VolumeSizeLimit != nil {
273+
warnings = append(warnings, "spec.dotnet.volumeSizeLimit is deprecated and will be removed in a future release; use spec.dotnet.volume.size instead")
274+
}
275+
if r.Spec.Go.VolumeSizeLimit != nil {
276+
warnings = append(warnings, "spec.go.volumeSizeLimit is deprecated and will be removed in a future release; use spec.go.volume.size instead")
277+
}
278+
if r.Spec.ApacheHttpd.VolumeSizeLimit != nil {
279+
warnings = append(warnings, "spec.apachehttpd.volumeSizeLimit is deprecated and will be removed in a future release; use spec.apachehttpd.volume.size instead")
280+
}
281+
if r.Spec.Nginx.VolumeSizeLimit != nil {
282+
warnings = append(warnings, "spec.nginx.volumeSizeLimit is deprecated and will be removed in a future release; use spec.nginx.volume.size instead")
283+
}
284+
262285
return warnings, nil
263286
}
264287

apis/v1alpha1/instrumentation_webhook_test.go

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,67 @@ func TestInstrumentationValidatingWebhook(t *testing.T) {
621621
})
622622
}
623623
}
624+
func TestInstrumentationValidatingWebhook_DeprecationWarnings(t *testing.T) {
625+
defaultSize := resource.MustParse("200Mi")
626+
627+
tests := []struct {
628+
name string
629+
inst Instrumentation
630+
want string
631+
}{
632+
{
633+
name: "java volumeSizeLimit deprecated",
634+
inst: Instrumentation{Spec: InstrumentationSpec{Java: Java{VolumeSizeLimit: &defaultSize}}},
635+
want: "spec.java.volumeSizeLimit is deprecated and will be removed in a future release; use spec.java.volume.size instead",
636+
},
637+
{
638+
name: "nodejs volumeSizeLimit deprecated",
639+
inst: Instrumentation{Spec: InstrumentationSpec{NodeJS: NodeJS{VolumeSizeLimit: &defaultSize}}},
640+
want: "spec.nodejs.volumeSizeLimit is deprecated and will be removed in a future release; use spec.nodejs.volume.size instead",
641+
},
642+
{
643+
name: "python volumeSizeLimit deprecated",
644+
inst: Instrumentation{Spec: InstrumentationSpec{Python: Python{VolumeSizeLimit: &defaultSize}}},
645+
want: "spec.python.volumeSizeLimit is deprecated and will be removed in a future release; use spec.python.volume.size instead",
646+
},
647+
{
648+
name: "dotnet volumeSizeLimit deprecated",
649+
inst: Instrumentation{Spec: InstrumentationSpec{DotNet: DotNet{VolumeSizeLimit: &defaultSize}}},
650+
want: "spec.dotnet.volumeSizeLimit is deprecated and will be removed in a future release; use spec.dotnet.volume.size instead",
651+
},
652+
{
653+
name: "go volumeSizeLimit deprecated",
654+
inst: Instrumentation{Spec: InstrumentationSpec{Go: Go{VolumeSizeLimit: &defaultSize}}},
655+
want: "spec.go.volumeSizeLimit is deprecated and will be removed in a future release; use spec.go.volume.size instead",
656+
},
657+
{
658+
name: "apachehttpd volumeSizeLimit deprecated",
659+
inst: Instrumentation{Spec: InstrumentationSpec{ApacheHttpd: ApacheHttpd{VolumeSizeLimit: &defaultSize}}},
660+
want: "spec.apachehttpd.volumeSizeLimit is deprecated and will be removed in a future release; use spec.apachehttpd.volume.size instead",
661+
},
662+
{
663+
name: "nginx volumeSizeLimit deprecated",
664+
inst: Instrumentation{Spec: InstrumentationSpec{Nginx: Nginx{VolumeSizeLimit: &defaultSize}}},
665+
want: "spec.nginx.volumeSizeLimit is deprecated and will be removed in a future release; use spec.nginx.volume.size instead",
666+
},
667+
}
668+
669+
for _, tt := range tests {
670+
t.Run(tt.name, func(t *testing.T) {
671+
warnings, err := InstrumentationWebhook{}.ValidateCreate(context.Background(), &tt.inst)
672+
assert.NoError(t, err)
673+
674+
found := false
675+
for _, w := range warnings {
676+
if w == tt.want {
677+
found = true
678+
break
679+
}
680+
}
681+
assert.True(t, found, "expected warnings to contain %q, got %v", tt.want, warnings)
682+
})
683+
}
684+
}
624685

625686
func TestInstrumentationJaegerRemote(t *testing.T) {
626687
tests := []struct {

bundle/community/manifests/opentelemetry-operator.clusterserviceversion.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ metadata:
9999
categories: Logging & Tracing,Monitoring
100100
certified: "false"
101101
containerImage: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator
102-
createdAt: "2025-10-17T09:24:13Z"
102+
createdAt: "2025-10-23T18:06:48Z"
103103
description: Provides the OpenTelemetry components, including the Collector
104104
operators.operatorframework.io/builder: operator-sdk-v1.29.0
105105
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3

bundle/openshift/manifests/opentelemetry-operator.clusterserviceversion.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ metadata:
9999
categories: Logging & Tracing,Monitoring
100100
certified: "false"
101101
containerImage: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator
102-
createdAt: "2025-10-17T09:24:14Z"
102+
createdAt: "2025-10-23T18:06:48Z"
103103
description: Provides the OpenTelemetry components, including the Collector
104104
operators.operatorframework.io/builder: operator-sdk-v1.29.0
105105
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3

docs/api/instrumentations.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,8 @@ If omitted, an emptyDir is used with size limit VolumeSizeLimit<br/>
270270
<td>int or string</td>
271271
<td>
272272
VolumeSizeLimit defines size limit for volume used for auto-instrumentation.
273-
The default size is 200Mi.<br/>
273+
The default size is 200Mi.
274+
Deprecated: use spec.<lang>.volume.size instead. This field will be inactive in a future release.<br/>
274275
</td>
275276
<td>false</td>
276277
</tr></tbody>
@@ -1453,7 +1454,8 @@ If omitted, an emptyDir is used with size limit VolumeSizeLimit<br/>
14531454
<td>int or string</td>
14541455
<td>
14551456
VolumeSizeLimit defines size limit for volume used for auto-instrumentation.
1456-
The default size is 200Mi.<br/>
1457+
The default size is 200Mi.
1458+
Deprecated: use spec.<lang>.volume.size instead. This field will be inactive in a future release.<br/>
14571459
</td>
14581460
<td>false</td>
14591461
</tr></tbody>
@@ -2708,7 +2710,8 @@ If omitted, an emptyDir is used with size limit VolumeSizeLimit<br/>
27082710
<td>int or string</td>
27092711
<td>
27102712
VolumeSizeLimit defines size limit for volume used for auto-instrumentation.
2711-
The default size is 200Mi.<br/>
2713+
The default size is 200Mi.
2714+
Deprecated: use spec.<lang>.volume.size instead. This field will be inactive in a future release.<br/>
27122715
</td>
27132716
<td>false</td>
27142717
</tr></tbody>
@@ -3598,7 +3601,8 @@ If omitted, an emptyDir is used with size limit VolumeSizeLimit<br/>
35983601
<td>int or string</td>
35993602
<td>
36003603
VolumeSizeLimit defines size limit for volume used for auto-instrumentation.
3601-
The default size is 200Mi.<br/>
3604+
The default size is 200Mi.
3605+
Deprecated: use spec.<lang>.volume.size instead. This field will be inactive in a future release.<br/>
36023606
</td>
36033607
<td>false</td>
36043608
</tr></tbody>
@@ -4531,7 +4535,8 @@ If omitted, an emptyDir is used with size limit VolumeSizeLimit<br/>
45314535
<td>int or string</td>
45324536
<td>
45334537
VolumeSizeLimit defines size limit for volume used for auto-instrumentation.
4534-
The default size is 200Mi.<br/>
4538+
The default size is 200Mi.
4539+
Deprecated: use spec.<lang>.volume.size instead. This field will be inactive in a future release.<br/>
45354540
</td>
45364541
<td>false</td>
45374542
</tr></tbody>
@@ -5683,7 +5688,8 @@ If omitted, an emptyDir is used with size limit VolumeSizeLimit<br/>
56835688
<td>int or string</td>
56845689
<td>
56855690
VolumeSizeLimit defines size limit for volume used for auto-instrumentation.
5686-
The default size is 200Mi.<br/>
5691+
The default size is 200Mi.
5692+
Deprecated: use spec.<lang>.volume.size instead. This field will be inactive in a future release.<br/>
56875693
</td>
56885694
<td>false</td>
56895695
</tr></tbody>
@@ -6565,7 +6571,8 @@ If omitted, an emptyDir is used with size limit VolumeSizeLimit<br/>
65656571
<td>int or string</td>
65666572
<td>
65676573
VolumeSizeLimit defines size limit for volume used for auto-instrumentation.
6568-
The default size is 200Mi.<br/>
6574+
The default size is 200Mi.
6575+
Deprecated: use spec.<lang>.volume.size instead. This field will be inactive in a future release.<br/>
65696576
</td>
65706577
<td>false</td>
65716578
</tr></tbody>

0 commit comments

Comments
 (0)