Skip to content

Commit 108de99

Browse files
authored
Merge branch 'main' into fix-allocator-metric
2 parents 874e21a + bfead6f commit 108de99

File tree

6 files changed

+40
-57
lines changed

6 files changed

+40
-57
lines changed

.chloggen/operator32.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ change_type: 'enhancement'
55
component: operator
66

77
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
8-
note: Support for Kubernetes `1.32` version.
8+
note: Add support for Kubernetes `1.32`
99

1010
# One or more tracking issues related to the change
11-
issues: [ ]
11+
issues: [3544]
1212

1313
# (Optional) One or more lines of additional information to render under the primary note.
1414
# These lines will be padded with 2 spaces and then inserted directly into the document.

.golangci.yaml

-4
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@ issues:
5757
- linters:
5858
- gci
5959
source: "// \\+kubebuilder"
60-
# For some reason goheader complains about these files, even though the headers are correct
61-
- linters:
62-
- goheader
63-
path: upgrade_strategy\.go
6460

6561
linters:
6662
enable:

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ KUSTOMIZE_VERSION ?= v5.5.0
496496
# renovate: datasource=go depName=sigs.k8s.io/controller-tools/cmd/controller-gen
497497
CONTROLLER_TOOLS_VERSION ?= v0.17.0
498498
# renovate: datasource=go depName=github.com/golangci/golangci-lint/cmd/golangci-lint
499-
GOLANGCI_LINT_VERSION ?= v1.63.2
499+
GOLANGCI_LINT_VERSION ?= v1.63.4
500500
# renovate: datasource=go depName=sigs.k8s.io/kind
501501
KIND_VERSION ?= v0.26.0
502502
# renovate: datasource=go depName=github.com/kyverno/chainsaw

main.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,9 @@ func main() {
287287
os.Exit(1)
288288
}
289289

290-
clientset, clientErr := kubernetes.NewForConfig(mgr.GetConfig())
290+
clientset, err := kubernetes.NewForConfig(mgr.GetConfig())
291291
if err != nil {
292-
setupLog.Error(clientErr, "failed to create kubernetes clientset")
292+
setupLog.Error(err, "failed to create kubernetes clientset")
293293
}
294294

295295
ctx := ctrl.SetupSignalHandler()

tests/e2e-openshift/export-to-cluster-logging-lokistack/check_logs.sh

+17-11
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,30 @@ TOKEN=$(oc -n openshift-logging create token otel-collector-deployment)
44
LOKI_URL=$(oc -n openshift-logging get route logging-loki -o json | jq '.spec.host' -r)
55

66
while true; do
7-
LOG_OUTPUT=$(logcli -o raw --tls-skip-verify \
7+
# Fetch logs
8+
RAW_OUTPUT=$(logcli -o raw --tls-skip-verify \
89
--bearer-token="${TOKEN}" \
910
--addr "https://${LOKI_URL}/api/logs/v1/application" query '{log_type="application"}')
1011

11-
if echo "$LOG_OUTPUT" | jq -e '
12-
. as $root |
13-
select(
14-
.body == "the message" and
15-
.severity == "Info" and
16-
.attributes.app == "server" and
17-
.resources."k8s.container.name" == "telemetrygen" and
18-
.resources."k8s.namespace.name" == "chainsaw-incllogs"
19-
)
20-
' > /dev/null; then
12+
# Extract the part of the output containing the common labels
13+
COMMON_LABELS=$(echo "$RAW_OUTPUT" | grep "Common labels:")
14+
15+
# Log output for the actual log messages
16+
LOG_OUTPUT=$(echo "$RAW_OUTPUT" | grep -v "Common labels:")
17+
18+
# Check if specific log messages exist
19+
if echo "$COMMON_LABELS" | grep -q 'app="server"' && \
20+
echo "$COMMON_LABELS" | grep -q 'k8s_container_name="telemetrygen"' && \
21+
echo "$COMMON_LABELS" | grep -q 'k8s_namespace_name="chainsaw-incllogs"' && \
22+
echo "$COMMON_LABELS" | grep -q 'kubernetes_container_name="telemetrygen"' && \
23+
echo "$COMMON_LABELS" | grep -q 'kubernetes_namespace_name="chainsaw-incllogs"' && \
24+
echo "$LOG_OUTPUT" | grep -q "the message"; then
2125
echo "Logs found:"
26+
echo "$COMMON_LABELS"
2227
break
2328
else
2429
echo "Logs not found. Continuing to check..."
2530
sleep 5
2631
fi
2732
done
33+

tests/e2e-openshift/export-to-cluster-logging-lokistack/otel-collector.yaml

+18-37
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ rules:
1717
- apiGroups: [""]
1818
resources: ["pods", "namespaces", "nodes"]
1919
verbs: ["get", "watch", "list"]
20+
- apiGroups: ["apps"]
21+
resources: ["replicasets"]
22+
verbs: ["get", "list", "watch"]
2023

2124
---
2225
apiVersion: rbac.authorization.k8s.io/v1
@@ -39,7 +42,7 @@ metadata:
3942
name: otel
4043
namespace: openshift-logging
4144
spec:
42-
image: ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:0.107.0
45+
image: ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:0.116.1
4346
serviceAccount: otel-collector-deployment
4447
config:
4548
extensions:
@@ -51,66 +54,44 @@ spec:
5154
grpc: {}
5255
http: {}
5356
processors:
54-
k8sattributes:
55-
auth_type: "serviceAccount"
56-
passthrough: false
57-
extract:
58-
metadata:
59-
- k8s.pod.name
60-
- k8s.container.name
61-
- k8s.namespace.name
62-
labels:
63-
- tag_name: app.label.component
64-
key: app.kubernetes.io/component
65-
from: pod
66-
pod_association:
67-
- sources:
68-
- from: resource_attribute
69-
name: k8s.pod.name
70-
- from: resource_attribute
71-
name: k8s.container.name
72-
- from: resource_attribute
73-
name: k8s.namespace.name
74-
- sources:
75-
- from: connection
57+
k8sattributes: {}
7658
resource:
7759
attributes:
78-
- key: loki.format
79-
action: insert
80-
value: json
81-
- key: kubernetes_namespace_name
60+
- key: kubernetes.namespace_name
8261
from_attribute: k8s.namespace.name
8362
action: upsert
84-
- key: kubernetes_pod_name
63+
- key: kubernetes.pod_name
8564
from_attribute: k8s.pod.name
8665
action: upsert
87-
- key: kubernetes_container_name
66+
- key: kubernetes.container_name
8867
from_attribute: k8s.container.name
8968
action: upsert
9069
- key: log_type
9170
value: application
9271
action: upsert
93-
- key: loki.resource.labels
94-
value: log_type, kubernetes_namespace_name, kubernetes_pod_name, kubernetes_container_name
95-
action: insert
9672
transform:
9773
log_statements:
9874
- context: log
9975
statements:
10076
- set(attributes["level"], ConvertCase(severity_text, "lower"))
101-
10277
exporters:
103-
loki:
104-
endpoint: https://logging-loki-gateway-http.openshift-logging.svc.cluster.local:8080/api/logs/v1/application/loki/api/v1/push
78+
otlphttp:
79+
endpoint: https://logging-loki-gateway-http.openshift-logging.svc.cluster.local:8080/api/logs/v1/application/otlp
80+
encoding: json
10581
tls:
10682
ca_file: "/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt"
10783
auth:
10884
authenticator: bearertokenauth
109-
85+
debug:
86+
verbosity: detailed
11087
service:
11188
extensions: [bearertokenauth]
11289
pipelines:
11390
logs:
11491
receivers: [otlp]
11592
processors: [k8sattributes, transform, resource]
116-
exporters: [loki]
93+
exporters: [otlphttp]
94+
logs/test:
95+
receivers: [otlp]
96+
processors: []
97+
exporters: [debug]

0 commit comments

Comments
 (0)