Skip to content

Commit a3644ad

Browse files
Release v0.57.2 (#1023)
* Release v0.57.2 Signed-off-by: Yuri Sa <[email protected]> * Release v0.57.2 Signed-off-by: Yuri Sa <[email protected]> * Added otel upgrade Signed-off-by: Yuri Sa <[email protected]> * Fixed linters Signed-off-by: Yuri Sa <[email protected]> * Fixed unit tests for 0.57.2 Signed-off-by: Yuri Sa <[email protected]> * Fixed requested topics Signed-off-by: Yuri Sa <[email protected]> * Fixed requested topics Signed-off-by: Yuri Sa <[email protected]> * Fixed version number Signed-off-by: Yuri Sa <[email protected]> * Fixed version number Signed-off-by: Yuri Sa <[email protected]> Signed-off-by: Yuri Sa <[email protected]> Co-authored-by: Vineeth Pothulapati <[email protected]>
1 parent 24ac119 commit a3644ad

7 files changed

+191
-9
lines changed

CHANGELOG.md

+16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
Changes by Version
22
==================
33

4+
0.57.2
5+
-------------------
6+
### 🚀 New components 🚀
7+
* Support DotNet auto-instrumentation ([#976](https://github.com/open-telemetry/opentelemetry-operator/pull/976), [@avadhut123pisal](https://github.com/avadhut123pisal))
8+
* Enable instrumentation injecting only core SDK config ([#1000](https://github.com/open-telemetry/opentelemetry-operator/pull/1000), [@bilbof](https://github.com/bilbof))
9+
### 💡 Enhancements 💡
10+
* chore(nodejs): update versions.txt to 0.31.0 ([#1015](https://github.com/open-telemetry/opentelemetry-operator/pull/1015), [@mat-rumian](https://github.com/mat-rumian))
11+
* chore(nodejs): update to 0.31.0 ([#955](https://github.com/open-telemetry/opentelemetry-operator/pull/955), [@mat-rumian](https://github.com/mat-rumian))
12+
* chore(operator): update python inst to 0.32b0 ([#1012](https://github.com/open-telemetry/opentelemetry-operator/pull/1012), [@ianmcnally](https://github.com/ianmcnally))
13+
* Sort order of ports returned to fix flaky tests ([#1003](https://github.com/open-telemetry/opentelemetry-operator/pull/1003), [@kevinearls](https://github.com/kevinearls))
14+
### 🧰 Bug fixes 🧰
15+
* Fix the issue that target-level metadata labels were missing (#948) ([#949](https://github.com/open-telemetry/opentelemetry-operator/pull/949), [@CoderPoet](https://github.com/CoderPoet))
16+
#### OpenTelemetry Collector and Contrib
17+
* [OpenTelemetry Collector - v0.57.2](https://github.com/open-telemetry/opentelemetry-collector/releases/tag/v0.57.2)
18+
* [OpenTelemetry Contrib - v0.57.2](https://github.com/open-telemetry/opentelemetry-collector-contrib/releases/tag/v0.57.2)
19+
420
0.56.0
521
-------------------
622
### 💡 Enhancements 💡

bundle/manifests/opentelemetry-operator.clusterserviceversion.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ metadata:
3737
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
3838
repository: github.com/open-telemetry/opentelemetry-operator
3939
support: OpenTelemetry Community
40-
name: opentelemetry-operator.v0.56.0
40+
name: opentelemetry-operator.v0.57.2
4141
namespace: placeholder
4242
spec:
4343
apiservicedefinitions: {}
@@ -282,7 +282,7 @@ spec:
282282
- args:
283283
- --metrics-addr=127.0.0.1:8080
284284
- --enable-leader-election
285-
image: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator:0.56.0
285+
image: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator:0.57.2
286286
livenessProbe:
287287
httpGet:
288288
path: /healthz
@@ -392,7 +392,7 @@ spec:
392392
maturity: alpha
393393
provider:
394394
name: OpenTelemetry Community
395-
version: 0.56.0
395+
version: 0.57.2
396396
webhookdefinitions:
397397
- admissionReviewVersions:
398398
- v1

pkg/collector/upgrade/v0_24_0_test.go

-4
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ func TestHealthCheckEndpointMigration(t *testing.T) {
4141
},
4242
Spec: v1alpha1.OpenTelemetryCollectorSpec{
4343
Config: `extensions:
44-
health_check:
45-
health_check/1: ""
4644
health_check/2:
4745
endpoint: "localhost:13133"
4846
health_check/3:
@@ -64,8 +62,6 @@ func TestHealthCheckEndpointMigration(t *testing.T) {
6462

6563
// verify
6664
assert.Equal(t, `extensions:
67-
health_check:
68-
health_check/1: ""
6965
health_check/2:
7066
endpoint: localhost:13133
7167
health_check/3:

pkg/collector/upgrade/v0_57_2.go

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
// Copyright The OpenTelemetry Authors
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package upgrade
16+
17+
import (
18+
"fmt"
19+
"strings"
20+
21+
"gopkg.in/yaml.v2"
22+
23+
"github.com/open-telemetry/opentelemetry-operator/apis/v1alpha1"
24+
"github.com/open-telemetry/opentelemetry-operator/pkg/collector/adapters"
25+
)
26+
27+
func upgrade0_57_2(u VersionUpgrade, otelcol *v1alpha1.OpenTelemetryCollector) (*v1alpha1.OpenTelemetryCollector, error) {
28+
29+
if len(otelcol.Spec.Config) == 0 {
30+
return otelcol, nil
31+
}
32+
33+
otelCfg, err := adapters.ConfigFromString(otelcol.Spec.Config)
34+
if err != nil {
35+
return otelcol, fmt.Errorf("couldn't upgrade to v0.57.2, failed to parse configuration: %w", err)
36+
}
37+
38+
//Remove deprecated port field from config. (https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/10853)
39+
extensionsConfig, ok := otelCfg["extensions"].(map[interface{}]interface{})
40+
if !ok {
41+
// In case there is no extensions config.
42+
return otelcol, nil
43+
}
44+
45+
for keyExt, valExt := range extensionsConfig {
46+
if strings.HasPrefix(keyExt.(string), "health_check") {
47+
switch extensions := valExt.(type) {
48+
case map[interface{}]interface{}:
49+
if port, ok := extensions["port"]; ok {
50+
endpointV := extensions["endpoint"]
51+
extensions["endpoint"] = fmt.Sprintf("%s:%s", endpointV, port)
52+
delete(extensions, "port")
53+
54+
otelCfg["extensions"] = extensionsConfig
55+
res, err := yaml.Marshal(otelCfg)
56+
if err != nil {
57+
return otelcol, fmt.Errorf("couldn't upgrade to v0.57.2, failed to marshall back configuration: %w", err)
58+
}
59+
60+
otelcol.Spec.Config = string(res)
61+
u.Recorder.Event(otelcol, "Normal", "Upgrade", fmt.Sprintf("upgrade to v0.57.2 has deprecated port for healthcheck extension %q", keyExt))
62+
}
63+
default:
64+
return otelcol, fmt.Errorf("couldn't upgrade to v0.57.2, the extension %q is invalid (expected string or map but was %t)", keyExt, valExt)
65+
}
66+
}
67+
}
68+
return otelcol, nil
69+
}

pkg/collector/upgrade/v0_57_2_test.go

+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
// Copyright The OpenTelemetry Authors
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package upgrade_test
16+
17+
import (
18+
"context"
19+
"testing"
20+
21+
"github.com/stretchr/testify/assert"
22+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
23+
"k8s.io/client-go/tools/record"
24+
25+
"github.com/open-telemetry/opentelemetry-operator/apis/v1alpha1"
26+
"github.com/open-telemetry/opentelemetry-operator/internal/version"
27+
"github.com/open-telemetry/opentelemetry-operator/pkg/collector/upgrade"
28+
)
29+
30+
func Test0_57_0Upgrade(t *testing.T) {
31+
collectorInstance := v1alpha1.OpenTelemetryCollector{
32+
TypeMeta: metav1.TypeMeta{
33+
Kind: "OpenTelemetryCollector",
34+
APIVersion: "v1alpha1",
35+
},
36+
ObjectMeta: metav1.ObjectMeta{
37+
Name: "otel-my-instance",
38+
Namespace: "somewhere",
39+
},
40+
Spec: v1alpha1.OpenTelemetryCollectorSpec{
41+
Config: `receivers:
42+
otlp:
43+
protocols:
44+
http:
45+
endpoint: mysite.local:55690
46+
extensions:
47+
health_check:
48+
endpoint: "localhost"
49+
port: "4444"
50+
check_collector_pipeline:
51+
enabled: false
52+
exporter_failure_threshold: 5
53+
interval: 5m
54+
service:
55+
extensions: [health_check]
56+
pipelines:
57+
metrics:
58+
receivers: [otlp]
59+
exporters: [nop]
60+
`,
61+
},
62+
}
63+
64+
collectorInstance.Status.Version = "0.56.0"
65+
//Test to remove port and change endpoint value.
66+
versionUpgrade := &upgrade.VersionUpgrade{
67+
Log: logger,
68+
Version: version.Get(),
69+
Client: k8sClient,
70+
Recorder: record.NewFakeRecorder(upgrade.RecordBufferSize),
71+
}
72+
73+
upgradedInstance, err := versionUpgrade.ManagedInstance(context.Background(), collectorInstance)
74+
assert.NoError(t, err)
75+
assert.Equal(t, `extensions:
76+
health_check:
77+
check_collector_pipeline:
78+
enabled: false
79+
exporter_failure_threshold: 5
80+
interval: 5m
81+
endpoint: localhost:4444
82+
receivers:
83+
otlp:
84+
protocols:
85+
http:
86+
endpoint: mysite.local:55690
87+
service:
88+
extensions:
89+
- health_check
90+
pipelines:
91+
metrics:
92+
exporters:
93+
- nop
94+
receivers:
95+
- otlp
96+
`, upgradedInstance.Spec.Config)
97+
}

pkg/collector/upgrade/versions.go

+4
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ var (
7777
Version: *semver.MustParse("0.56.0"),
7878
upgrade: upgrade0_56_0,
7979
},
80+
{
81+
Version: *semver.MustParse("0.57.2"),
82+
upgrade: upgrade0_57_2,
83+
},
8084
}
8185

8286
// Latest represents the latest version that we need to upgrade. This is not necessarily the latest known version.

versions.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
# by default with the OpenTelemetry Operator. This would usually be the latest
33
# stable OpenTelemetry version. When you update this file, make sure to update the
44
# the docs as well.
5-
opentelemetry-collector=0.56.0
5+
opentelemetry-collector=0.57.2
66

77
# Represents the current release of the OpenTelemetry Operator.
8-
operator=0.56.0
8+
operator=0.57.2
99

1010
# Represents the current release of the Target Allocator.
1111
targetallocator=0.1.0

0 commit comments

Comments
 (0)