Skip to content

Commit

Permalink
Pass the namespace to k8sattributes in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
quentinmit committed Jun 11, 2024
1 parent 77a2f28 commit d025ae7
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gcp/helmfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ environments:
values:
- namespace: otel-demo
cicd:
values: []
# namespace must be specified on the command line
values:
- single_namespace: true
# namespace must be specified on the command line
---
repositories:
- name: open-telemetry
Expand All @@ -36,3 +37,4 @@ releases:
values:
- opentelemetry-demo-values.yaml
- opentelemetry-demo-workload-identity.yaml.gotmpl
- opentelemetry-demo-cicd.yaml.gotmpl
26 changes: 26 additions & 0 deletions gcp/opentelemetry-demo-cicd.yaml.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# this file is used by Helm chart launch steps.
# when merging YAML with the default values, objects are merged but lists are overwritten.
# so, where a list is used, we have copied the defaults from the upstream values to preserve them.

{{ if .Values | getOrNil "single_namespace" }}
opentelemetry-collector:
config:
processors:
k8sattributes:
filter:
namespace: {{ .Values.namespace }}
{{ end }}

0 comments on commit d025ae7

Please sign in to comment.