Skip to content

Commit 94b85f4

Browse files
committed
Resolving conflicts and e2e
2 parents 202aef1 + d4b24f3 commit 94b85f4

File tree

106 files changed

+31791
-13864
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+31791
-13864
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
2+
change_type: bug_fix
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: collector
6+
7+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
8+
note: "Fix the RBAC resources creation when the processor was only enabled"
9+
10+
# One or more tracking issues related to the change
11+
issues: [2788]
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:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
2+
change_type: breaking
3+
4+
# The name of the component, or a single word describing the area of concern, (e.g. operator, target allocator, github action)
5+
component: operator
6+
7+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
8+
note: change nginx instrumentation feature gate operator.autoinstrumentation.nginx into command line flag --enable-nginx-instrumentation
9+
10+
# One or more tracking issues related to the change
11+
issues: [2582, 2676]
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:

.chloggen/featuregate_cli_python.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
2+
change_type: breaking
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: operator
6+
7+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
8+
note: remove featuregate `operator.autoinstrumentation.python`. Use command line flag `--enable-python-instrumentation` instead
9+
10+
# One or more tracking issues related to the change
11+
issues: [2582, 2672]
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:

.chloggen/fix-2655.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
2+
change_type: bug_fix
3+
4+
# The name of the component, or a single word describing the area of concern, (e.g. operator, target allocator, github action)
5+
component: instrumentation
6+
7+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
8+
note: "Don't preserve ownership of files copied from the autoinstrumenation image. This avoids issues when instrumenting workloads running as non-root"
9+
10+
# One or more tracking issues related to the change
11+
issues: [2655]
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:
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
2+
change_type: bug_fix
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: opamp bridge
6+
7+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
8+
note: Fix opamp bridge configmap "app.kubernetes.io/version" label to be generated in the same way as other resource version labels
9+
10+
# One or more tracking issues related to the change
11+
issues: [2583]
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:
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
2+
change_type: breaking
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: target allocator
6+
7+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
8+
note: Promote `operator.collector.rewritetargetallocator` feature flag to stable
9+
10+
# One or more tracking issues related to the change
11+
issues: [2796]
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:
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
2+
change_type: enhancement
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: instrumentation
6+
7+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
8+
note: Remove env var prefix validation
9+
10+
# One or more tracking issues related to the change
11+
issues: [2768]
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:

.chloggen/v1beta1-webhook.yaml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
2+
change_type: new_component
3+
4+
# The name of the component, or a single word describing the area of concern, (e.g. operator, target allocator, github action)
5+
component: collector
6+
7+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
8+
note: Enable reconciliation of Collector v1beta1 CRD.
9+
10+
# One or more tracking issues related to the change
11+
issues: [2620]
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+
Users are expected to migrate to `otelcol.v1beta1.opentelemetry.io`.
18+
The support for `otelcol.v1alpha1.opentelemetry.io` will be removed in the future.
19+
Follow [migration guide](https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definition-versioning/#upgrade-existing-objects-to-a-new-stored-version) for upgrading already created collector instances.
20+
After all `otelcol.v1alpha1.opentelemetry.io` are stored as `v1beta1` update the collector CRD to store only `v1beta1`
21+
`kubectl patch customresourcedefinitions opentelemetrycollectors.opentelemetry.io --subresource='status' --type='merge' -p '{"status":{"storedVersions":["v1beta1"]}}'`.
22+
**Only `AllNamespaces` install mode is now supported** due to the conversion webhook from `v1beta1` to `v1alpha1`.
23+
See [OLM docs](https://olm.operatorframework.io/docs/tasks/install-operator-with-olm/) and
24+
[OLM operator groups docs](https://olm.operatorframework.io/docs/advanced-tasks/operator-scoping-with-operatorgroups/).
25+

.github/workflows/e2e.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ jobs:
3434
- e2e-multi-instrumentation
3535
- e2e-metadata-filters
3636
include:
37+
- group: e2e-autoscale
38+
setup: "add-operator-arg OPERATOR_ARG=--enable-go-instrumentation prepare-e2e"
3739
- group: e2e-multi-instrumentation
3840
setup: "add-operator-arg OPERATOR_ARG=--enable-multi-instrumentation prepare-e2e"
3941
- group: e2e-metadata-filters
@@ -53,7 +55,7 @@ jobs:
5355
path: bin
5456
key: ${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('Makefile') }}-${{ steps.setup-go.outputs.go-version }}
5557
- name: Install chainsaw
56-
uses: kyverno/[email protected].8
58+
uses: kyverno/[email protected].9
5759
- name: Install tools
5860
run: make install-tools
5961
- name: Prepare e2e tests

Makefile

+3-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ BUNDLE_DEFAULT_CHANNEL := --default-channel=$(DEFAULT_CHANNEL)
3939
endif
4040
BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)
4141

42-
CRD_OPTIONS ?= "crd:generateEmbeddedObjectMeta=true,maxDescLen=200"
42+
# kubectl apply does not work on large CRDs.
43+
CRD_OPTIONS ?= "crd:generateEmbeddedObjectMeta=true,maxDescLen=0"
4344

4445
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
4546
ifeq (,$(shell go env GOBIN))
@@ -369,7 +370,7 @@ GOLANGCI_LINT ?= $(LOCALBIN)/golangci-lint
369370
CHAINSAW ?= $(LOCALBIN)/chainsaw
370371

371372
KUSTOMIZE_VERSION ?= v5.0.3
372-
CONTROLLER_TOOLS_VERSION ?= v0.12.0
373+
CONTROLLER_TOOLS_VERSION ?= v0.14.0
373374
GOLANGCI_LINT_VERSION ?= v1.54.0
374375
KIND_VERSION ?= v0.20.0
375376
CHAINSAW_VERSION ?= v0.1.7

apis/v1alpha1/collector_webhook.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ func warningsGroupedByResource(reviews []*v1.SubjectAccessReview) []string {
451451
func SetupCollectorWebhook(mgr ctrl.Manager, cfg config.Config, reviewer *rbac.Reviewer) error {
452452
cvw := &CollectorWebhook{
453453
reviewer: reviewer,
454-
logger: mgr.GetLogger().WithValues("handler", "CollectorWebhook"),
454+
logger: mgr.GetLogger().WithValues("handler", "CollectorWebhook", "version", "v1alpha1"),
455455
scheme: mgr.GetScheme(),
456456
cfg: cfg,
457457
}

apis/v1alpha1/instrumentation_webhook.go

-40
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@ import (
3131
"github.com/open-telemetry/opentelemetry-operator/pkg/constants"
3232
)
3333

34-
const (
35-
envPrefix = "OTEL_"
36-
envSplunkPrefix = "SPLUNK_"
37-
)
38-
3934
var (
4035
_ admission.CustomValidator = &InstrumentationWebhook{}
4136
_ admission.CustomDefaulter = &InstrumentationWebhook{}
@@ -245,44 +240,9 @@ func (w InstrumentationWebhook) validate(r *Instrumentation) (admission.Warnings
245240
default:
246241
return warnings, fmt.Errorf("spec.sampler.type is not valid: %s", r.Spec.Sampler.Type)
247242
}
248-
249-
// validate env vars
250-
if err := w.validateEnv(r.Spec.Env); err != nil {
251-
return warnings, err
252-
}
253-
if err := w.validateEnv(r.Spec.Java.Env); err != nil {
254-
return warnings, err
255-
}
256-
if err := w.validateEnv(r.Spec.NodeJS.Env); err != nil {
257-
return warnings, err
258-
}
259-
if err := w.validateEnv(r.Spec.Python.Env); err != nil {
260-
return warnings, err
261-
}
262-
if err := w.validateEnv(r.Spec.DotNet.Env); err != nil {
263-
return warnings, err
264-
}
265-
if err := w.validateEnv(r.Spec.Go.Env); err != nil {
266-
return warnings, err
267-
}
268-
if err := w.validateEnv(r.Spec.ApacheHttpd.Env); err != nil {
269-
return warnings, err
270-
}
271-
if err := w.validateEnv(r.Spec.Nginx.Env); err != nil {
272-
return warnings, err
273-
}
274243
return warnings, nil
275244
}
276245

277-
func (w InstrumentationWebhook) validateEnv(envs []corev1.EnvVar) error {
278-
for _, env := range envs {
279-
if !strings.HasPrefix(env.Name, envPrefix) && !strings.HasPrefix(env.Name, envSplunkPrefix) {
280-
return fmt.Errorf("env name should start with \"OTEL_\" or \"SPLUNK_\": %s", env.Name)
281-
}
282-
}
283-
return nil
284-
}
285-
286246
func validateJaegerRemoteSamplerArgument(argument string) error {
287247
parts := strings.Split(argument, ",")
288248

apis/v1alpha1/opentelemetrycollector_types.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -438,8 +438,8 @@ type OpenTelemetryCollectorStatus struct {
438438
Replicas int32 `json:"replicas,omitempty"`
439439
}
440440

441+
// +kubebuilder:deprecatedversion:warning="OpenTelemetryCollector v1alpha1 is deprecated. Migrate to v1beta1."
441442
// +kubebuilder:object:root=true
442-
// +kubebuilder:storageversion
443443
// +kubebuilder:resource:shortName=otelcol;otelcols
444444
// +kubebuilder:subresource:status
445445
// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.scale.replicas,selectorpath=.status.scale.selector

apis/v1alpha1/zz_generated.deepcopy.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apis/v1beta1/collector_webhook.go

+27
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,30 @@ import (
1919
"fmt"
2020
"strings"
2121

22+
"github.com/go-logr/logr"
2223
"k8s.io/apimachinery/pkg/runtime"
24+
ctrl "sigs.k8s.io/controller-runtime"
2325
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
26+
27+
"github.com/open-telemetry/opentelemetry-operator/internal/config"
28+
"github.com/open-telemetry/opentelemetry-operator/internal/rbac"
2429
)
2530

2631
var (
2732
_ admission.CustomValidator = &CollectorWebhook{}
2833
_ admission.CustomDefaulter = &CollectorWebhook{}
2934
)
3035

36+
// +kubebuilder:webhook:path=/mutate-opentelemetry-io-v1beta1-opentelemetrycollector,mutating=true,failurePolicy=fail,groups=opentelemetry.io,resources=opentelemetrycollectors,verbs=create;update,versions=v1beta1,name=mopentelemetrycollectorbeta.kb.io,sideEffects=none,admissionReviewVersions=v1
37+
// +kubebuilder:webhook:verbs=create;update,path=/validate-opentelemetry-io-v1beta1-opentelemetrycollector,mutating=false,failurePolicy=fail,groups=opentelemetry.io,resources=opentelemetrycollectors,versions=v1beta1,name=vopentelemetrycollectorcreateupdatebeta.kb.io,sideEffects=none,admissionReviewVersions=v1
38+
// +kubebuilder:webhook:verbs=delete,path=/validate-opentelemetry-io-v1beta1-opentelemetrycollector,mutating=false,failurePolicy=ignore,groups=opentelemetry.io,resources=opentelemetrycollectors,versions=v1beta1,name=vopentelemetrycollectordeletebeta.kb.io,sideEffects=none,admissionReviewVersions=v1
3139
// +kubebuilder:object:generate=false
40+
3241
type CollectorWebhook struct {
42+
logger logr.Logger
43+
cfg config.Config
44+
scheme *runtime.Scheme
45+
reviewer *rbac.Reviewer
3346
}
3447

3548
func (c CollectorWebhook) Default(_ context.Context, obj runtime.Object) error {
@@ -77,3 +90,17 @@ func (c CollectorWebhook) validate(r *OpenTelemetryCollector) (admission.Warning
7790
}
7891
return warnings, nil
7992
}
93+
94+
func SetupCollectorWebhook(mgr ctrl.Manager, cfg config.Config, reviewer *rbac.Reviewer) error {
95+
cvw := &CollectorWebhook{
96+
reviewer: reviewer,
97+
logger: mgr.GetLogger().WithValues("handler", "CollectorWebhook", "version", "v1beta1"),
98+
scheme: mgr.GetScheme(),
99+
cfg: cfg,
100+
}
101+
return ctrl.NewWebhookManagedBy(mgr).
102+
For(&OpenTelemetryCollector{}).
103+
WithValidator(cvw).
104+
WithDefaulter(cvw).
105+
Complete()
106+
}

apis/v1beta1/opentelemetrycollector_types.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
// +kubebuilder:skip
16-
1715
package v1beta1
1816

1917
import (
@@ -28,6 +26,7 @@ func init() {
2826

2927
// +kubebuilder:object:root=true
3028
// +kubebuilder:resource:shortName=otelcol;otelcols
29+
// +kubebuilder:storageversion
3130
// +kubebuilder:subresource:status
3231
// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.scale.replicas,selectorpath=.status.scale.selector
3332
// +kubebuilder:printcolumn:name="Mode",type="string",JSONPath=".spec.mode",description="Deployment Mode"

apis/v1beta1/targetallocator_types.go

-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
// +kubebuilder:skip
16-
1715
package v1beta1
1816

1917
import (

apis/v1beta1/zz_generated.deepcopy.go

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

autoinstrumentation/java/version.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.1.0
1+
2.2.0

autoinstrumentation/nodejs/package.json

+13-13
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@
1010
},
1111
"devDependencies": {
1212
"copyfiles": "^2.4.1",
13-
"rimraf": "^3.0.2",
14-
"typescript": "^4.4.4"
13+
"rimraf": "^5.0.5",
14+
"typescript": "^5.4.2"
1515
},
1616
"dependencies": {
17-
"@opentelemetry/api": "1.7.0",
17+
"@opentelemetry/api": "1.8.0",
1818
"@opentelemetry/auto-instrumentations-node": "0.43.0",
19-
"@opentelemetry/exporter-metrics-otlp-grpc": "0.46.0",
20-
"@opentelemetry/exporter-prometheus": "0.46.0",
21-
"@opentelemetry/exporter-trace-otlp-grpc": "0.46.0",
22-
"@opentelemetry/resource-detector-alibaba-cloud": "0.28.4",
23-
"@opentelemetry/resource-detector-aws": "1.3.4",
24-
"@opentelemetry/resource-detector-container": "0.3.4",
25-
"@opentelemetry/resource-detector-gcp": "0.29.4",
26-
"@opentelemetry/resources": "1.19.0",
27-
"@opentelemetry/sdk-metrics": "1.19.0",
28-
"@opentelemetry/sdk-node": "0.46.0"
19+
"@opentelemetry/exporter-metrics-otlp-grpc": "0.49.1",
20+
"@opentelemetry/exporter-prometheus": "0.49.1",
21+
"@opentelemetry/exporter-trace-otlp-grpc": "0.49.1",
22+
"@opentelemetry/resource-detector-alibaba-cloud": "0.28.7",
23+
"@opentelemetry/resource-detector-aws": "1.4.0",
24+
"@opentelemetry/resource-detector-container": "0.3.7",
25+
"@opentelemetry/resource-detector-gcp": "0.29.7",
26+
"@opentelemetry/resources": "1.22.0",
27+
"@opentelemetry/sdk-metrics": "1.22.0",
28+
"@opentelemetry/sdk-node": "0.49.1"
2929
}
3030
}

0 commit comments

Comments
 (0)