Skip to content

Commit daaab63

Browse files
author
Israel Blancas
authored
Merge branch 'main' into bug/3281
2 parents f242919 + cf9f890 commit daaab63

31 files changed

+1504
-406
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: 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: operator
6+
7+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
8+
note: "Deprecated `label` flag and introduced `labels-filter` flag to align the label filtering with the attribute filtering flag name. The `label` flag will be removed when #3236 issue is resolved."
9+
10+
# One or more tracking issues related to the change
11+
issues: [3218]
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/bug-fix-hpa.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: 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: collector
6+
7+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
8+
note: adds test for memory utilization
9+
10+
# One or more tracking issues related to the change
11+
issues: [3283]
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:

.github/workflows/e2e.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
- group: e2e-multi-instrumentation
4141
setup: "add-multi-instrumentation-params prepare-e2e"
4242
- group: e2e-metadata-filters
43-
setup: "add-operator-arg OPERATOR_ARG='--annotations-filter=.*filter.out --annotations-filter=config.*.gke.io.* --labels=.*filter.out' prepare-e2e"
43+
setup: "add-operator-arg OPERATOR_ARG='--annotations-filter=.*filter.out --annotations-filter=config.*.gke.io.* --labels-filter=.*filter.out' prepare-e2e"
4444
- group: e2e-automatic-rbac
4545
setup: "add-rbac-permissions-to-operator prepare-e2e"
4646
steps:

apis/v1beta1/config.go

+41-1
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@ import (
2727
"github.com/go-logr/logr"
2828
"gopkg.in/yaml.v3"
2929
corev1 "k8s.io/api/core/v1"
30+
rbacv1 "k8s.io/api/rbac/v1"
3031

3132
"github.com/open-telemetry/opentelemetry-operator/internal/components"
3233
"github.com/open-telemetry/opentelemetry-operator/internal/components/exporters"
34+
"github.com/open-telemetry/opentelemetry-operator/internal/components/processors"
3335
"github.com/open-telemetry/opentelemetry-operator/internal/components/receivers"
3436
)
3537

@@ -152,9 +154,43 @@ type Config struct {
152154
Service Service `json:"service" yaml:"service"`
153155
}
154156

157+
// getRbacRulesForComponentKinds gets the RBAC Rules for the given ComponentKind(s).
158+
func (c *Config) getRbacRulesForComponentKinds(logger logr.Logger, componentKinds ...ComponentKind) ([]rbacv1.PolicyRule, error) {
159+
var rules []rbacv1.PolicyRule
160+
enabledComponents := c.GetEnabledComponents()
161+
for _, componentKind := range componentKinds {
162+
var retriever components.ParserRetriever
163+
var cfg AnyConfig
164+
switch componentKind {
165+
case KindReceiver:
166+
retriever = receivers.ReceiverFor
167+
cfg = c.Receivers
168+
case KindExporter:
169+
retriever = exporters.ParserFor
170+
cfg = c.Exporters
171+
case KindProcessor:
172+
retriever = processors.ProcessorFor
173+
if c.Processors == nil {
174+
cfg = AnyConfig{}
175+
} else {
176+
cfg = *c.Processors
177+
}
178+
}
179+
for componentName := range enabledComponents[componentKind] {
180+
// TODO: Clean up the naming here and make it simpler to use a retriever.
181+
parser := retriever(componentName)
182+
if parsedRules, err := parser.GetRBACRules(logger, cfg.Object[componentName]); err != nil {
183+
return nil, err
184+
} else {
185+
rules = append(rules, parsedRules...)
186+
}
187+
}
188+
}
189+
return rules, nil
190+
}
191+
155192
// getPortsForComponentKinds gets the ports for the given ComponentKind(s).
156193
func (c *Config) getPortsForComponentKinds(logger logr.Logger, componentKinds ...ComponentKind) ([]corev1.ServicePort, error) {
157-
158194
var ports []corev1.ServicePort
159195
enabledComponents := c.GetEnabledComponents()
160196
for _, componentKind := range componentKinds {
@@ -200,6 +236,10 @@ func (c *Config) GetAllPorts(logger logr.Logger) ([]corev1.ServicePort, error) {
200236
return c.getPortsForComponentKinds(logger, KindReceiver, KindExporter)
201237
}
202238

239+
func (c *Config) GetAllRbacRules(logger logr.Logger) ([]rbacv1.PolicyRule, error) {
240+
return c.getRbacRulesForComponentKinds(logger, KindReceiver, KindExporter, KindProcessor)
241+
}
242+
203243
// Yaml encodes the current object and returns it as a string.
204244
func (c *Config) Yaml() (string, error) {
205245
var buf bytes.Buffer

autoinstrumentation/java/version.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.7.0
1+
2.8.0

go.mod

+26-25
Original file line numberDiff line numberDiff line change
@@ -22,32 +22,32 @@ require (
2222
github.com/openshift/api v0.0.0-20240124164020-e2ce40831f2e
2323
github.com/operator-framework/operator-lib v0.15.0
2424
github.com/prometheus-operator/prometheus-operator v0.76.0
25-
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.76.1
26-
github.com/prometheus-operator/prometheus-operator/pkg/client v0.76.1
25+
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.76.2
26+
github.com/prometheus-operator/prometheus-operator/pkg/client v0.76.2
2727
github.com/prometheus/client_golang v1.20.3
2828
github.com/prometheus/common v0.59.1
2929
github.com/prometheus/prometheus v0.54.1
3030
github.com/shirou/gopsutil v3.21.11+incompatible
3131
github.com/spf13/pflag v1.0.5
3232
github.com/stretchr/testify v1.9.0
33-
go.opentelemetry.io/collector/featuregate v1.14.1
34-
go.opentelemetry.io/otel v1.29.0
35-
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.29.0
36-
go.opentelemetry.io/otel/exporters/prometheus v0.51.0
37-
go.opentelemetry.io/otel/metric v1.29.0
38-
go.opentelemetry.io/otel/sdk v1.29.0
39-
go.opentelemetry.io/otel/sdk/metric v1.29.0
33+
go.opentelemetry.io/collector/featuregate v1.15.0
34+
go.opentelemetry.io/otel v1.30.0
35+
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.30.0
36+
go.opentelemetry.io/otel/exporters/prometheus v0.52.0
37+
go.opentelemetry.io/otel/metric v1.30.0
38+
go.opentelemetry.io/otel/sdk v1.30.0
39+
go.opentelemetry.io/otel/sdk/metric v1.30.0
4040
go.uber.org/multierr v1.11.0
4141
go.uber.org/zap v1.27.0
4242
gopkg.in/yaml.v2 v2.4.0
4343
gopkg.in/yaml.v3 v3.0.1
44-
k8s.io/api v0.31.0
45-
k8s.io/apiextensions-apiserver v0.31.0
46-
k8s.io/apimachinery v0.31.0
47-
k8s.io/client-go v0.31.0
48-
k8s.io/component-base v0.31.0
44+
k8s.io/api v0.31.1
45+
k8s.io/apiextensions-apiserver v0.31.1
46+
k8s.io/apimachinery v0.31.1
47+
k8s.io/client-go v0.31.1
48+
k8s.io/component-base v0.31.1
4949
k8s.io/klog/v2 v2.130.1
50-
k8s.io/kubectl v0.31.0
50+
k8s.io/kubectl v0.31.1
5151
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8
5252
sigs.k8s.io/controller-runtime v0.19.0
5353
sigs.k8s.io/yaml v1.4.0
@@ -86,7 +86,7 @@ require (
8686
github.com/edsrzf/mmap-go v1.1.0 // indirect
8787
github.com/efficientgo/core v1.0.0-rc.2 // indirect
8888
github.com/emicklei/go-restful/v3 v3.12.1 // indirect
89-
github.com/envoyproxy/go-control-plane v0.12.0 // indirect
89+
github.com/envoyproxy/go-control-plane v0.12.1-0.20240621013728-1eb8caab5155 // indirect
9090
github.com/envoyproxy/protoc-gen-validate v1.0.4 // indirect
9191
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
9292
github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb // indirect
@@ -176,6 +176,7 @@ require (
176176
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
177177
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
178178
github.com/pkg/errors v0.9.1 // indirect
179+
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
179180
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
180181
github.com/prometheus-community/prom-label-proxy v0.11.0 // indirect
181182
github.com/prometheus/alertmanager v0.27.0 // indirect
@@ -194,26 +195,26 @@ require (
194195
go.mongodb.org/mongo-driver v1.14.0 // indirect
195196
go.opencensus.io v0.24.0 // indirect
196197
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
197-
go.opentelemetry.io/otel/trace v1.29.0 // indirect
198+
go.opentelemetry.io/otel/trace v1.30.0 // indirect
198199
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
199200
go.uber.org/atomic v1.11.0 // indirect
200201
golang.org/x/arch v0.8.0 // indirect
201-
golang.org/x/crypto v0.26.0 // indirect
202+
golang.org/x/crypto v0.27.0 // indirect
202203
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa // indirect
203204
golang.org/x/mod v0.20.0 // indirect
204-
golang.org/x/net v0.28.0 // indirect
205+
golang.org/x/net v0.29.0 // indirect
205206
golang.org/x/oauth2 v0.22.0 // indirect
206207
golang.org/x/sync v0.8.0 // indirect
207-
golang.org/x/sys v0.24.0 // indirect
208-
golang.org/x/term v0.23.0 // indirect
209-
golang.org/x/text v0.17.0 // indirect
208+
golang.org/x/sys v0.25.0 // indirect
209+
golang.org/x/term v0.24.0 // indirect
210+
golang.org/x/text v0.18.0 // indirect
210211
golang.org/x/time v0.6.0 // indirect
211212
golang.org/x/tools v0.24.0 // indirect
212213
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
213214
google.golang.org/api v0.188.0 // indirect
214-
google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd // indirect
215-
google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd // indirect
216-
google.golang.org/grpc v1.65.0 // indirect
215+
google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect
216+
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect
217+
google.golang.org/grpc v1.66.1 // indirect
217218
google.golang.org/protobuf v1.34.2 // indirect
218219
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
219220
gopkg.in/inf.v0 v0.9.1 // indirect

0 commit comments

Comments
 (0)