Skip to content

Commit

Permalink
Add YAML
Browse files Browse the repository at this point in the history
  • Loading branch information
jkroepke committed Jun 7, 2024
1 parent 8804053 commit 2fa5b00
Show file tree
Hide file tree
Showing 11 changed files with 173 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@ credentials.auto.tfvars
!**/.local/.gitkeep

ansible.log

.idea
data-*/
*-amd64
*-arm64
24 changes: 24 additions & 0 deletions go/map_cast/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/trivago/tgo v1.0.7 h1:uaWH/XIy9aWYWpjm2CU3RpcqZXmX2ysQ9/Go+d9gyrM=
github.com/trivago/tgo v1.0.7/go.mod h1:w4dpD+3tzNIIiIfkWWa85w5/B77tlvdZckQ+6PkFnhc=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
22 changes: 22 additions & 0 deletions grafana-alloy/reload-issue/main.river
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import.file "metadata" {
filename = "metadata.river"
detector = "poll"
poll_frequency = "86400s"
}

metadata.config "this" {}

import.file "module" {
filename = "module.river"
detector = "poll"
poll_frequency = "86400s"
}

module.config "this" {
external_labels = {
direct = metadata.config.this.direct,
coalesce = metadata.config.this.coalesce,
nonsensitive = metadata.config.this.nonsensitive,
opsstack = metadata.config.this.opsstack,
}
}
23 changes: 23 additions & 0 deletions grafana-alloy/reload-issue/metadata.river
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
declare "config" {
remote.http "test" {
url = "http://localhost:8000/test.txt"
poll_frequency = "5s"
poll_timeout = "1s"
}

export "direct" {
value = remote.http.test.content
}

export "coalesce" {
value = coalesce(remote.http.test.content, "unset")
}

export "nonsensitive" {
value = nonsensitive(remote.http.test.content)
}

export "opsstack" {
value = coalesce(env("OPSSTACK_AGENT_ROLE"), to_lower(join(json_path(nonsensitive(remote.http.test.content), "$.tagsList[?(@.name=='cdt-opsstack-role')].value"), "")), "none")
}
}
35 changes: 35 additions & 0 deletions grafana-alloy/reload-issue/module.river
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
declare "config" {

argument "external_labels" {
optional = true
default = {}
}

prometheus.exporter.self "alloy" {}

prometheus.scrape "alloy" {
targets = prometheus.exporter.self.alloy.targets
forward_to = [prometheus.relabel.alloy.receiver]
}

prometheus.relabel "alloy" {
forward_to = []

rule {
target_label = "direct"
replacement = argument.external_labels.value.direct
}
rule {
target_label = "coalesce"
replacement = argument.external_labels.value.coalesce
}
rule {
target_label = "nonsensitive"
replacement = argument.external_labels.value.nonsensitive
}
rule {
target_label = "opsstack"
replacement = argument.external_labels.value.opsstack
}
}
}
1 change: 1 addition & 0 deletions grafana-alloy/reload-issue/test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"tagsList":[{"name":"cdt-opsstack-role","value":"3"}]}
3 changes: 3 additions & 0 deletions helm-chart-examples/default/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
apiVersion: v2
name: printf
version: 1.0.0
3 changes: 3 additions & 0 deletions helm-chart-examples/default/templates/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
demo: |
{{ (get .Values.not "a" ).a | default "default" }}
11 changes: 11 additions & 0 deletions helm-chart-examples/default/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
a:
b:
c:
d:
e: Hello

cert-manager:
serviceAccount:
annotations:
"azure.workload.identity/client-id": ABCD

1 change: 1 addition & 0 deletions test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2
45 changes: 45 additions & 0 deletions win-linux/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
FROM debian:12

ARG DEBIAN_FRONTEND=noninteractive
ARG WINE_VERSION=9.6~bookworm-1
ARG WINE_MONO_VERSION=9.0.0
ARG DOTNET_VERSION=8.0.204
ARG DOTNET_DOWNLOAD_URL=https://download.visualstudio.microsoft.com/download/pr/7ec1e77e-07d3-43b6-a688-847507046206/d83ec453d53a308d9f614de81b152594/dotnet-sdk-8.0.204-win-x86.exe

ENV WINEPATH="C:\\users\\wix\\.dotnet\\tools" \
WINEPREFIX="/home/wix/.wine" \
WINEARCH=win32 \
WINEDEBUG=-all \
DOTNET_CLI_TELEMETRY_OPTOUT=1 \
DOTNET_GENERATE_ASPNET_CERTIFICATE=false

RUN set -ex \
&& dpkg --add-architecture i386 \
&& apt-get update -qq \
&& apt-get install --no-install-recommends ca-certificates curl xauth xvfb xz-utils -qqy \
&& curl -sSfLo /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key \
&& curl -sSfLo /etc/apt/sources.list.d/winehq-bookworm.sources https://dl.winehq.org/wine-builds/debian/dists/bookworm/winehq-bookworm.sources \
&& apt-get update -qq && apt-get install --no-install-recommends winehq-staging=${WINE_VERSION} -qqy \
&& useradd -m wix \
&& apt-get clean autoclean && apt-get autoremove --yes && rm -rf /var/lib/{apt,dpkg,cache,log}/ \
&& mkdir -p /opt/wine/mono/ && chown -R wix:wix /opt/wine/mono/ \
\
# https://github.com/dotnet/runtime/issues/98441
&& printf '#!/bin/sh\nexec script --return --quiet -c "wine dotnet $*" /dev/null' > /usr/local/bin/dotnet \
&& printf '#!/bin/sh\nexec wine wix.exe $@' > /usr/local/bin/wix.exe \
&& chmod +x /usr/local/bin/dotnet /usr/local/bin/wix.exe \
&& ln -sf /usr/local/bin/wix.exe /usr/local/bin/wix

USER wix


RUN set -ex \
&& curl -sSfLo /tmp/wine-mono-${WINE_MONO_VERSION}-x86.tar.xz https://dl.winehq.org/wine/wine-mono/${WINE_MONO_VERSION}/wine-mono-${WINE_MONO_VERSION}-x86.tar.xz \
&& tar -xf /tmp/wine-mono-${WINE_MONO_VERSION}-x86.tar.xz -C /opt/wine/mono/ \
&& rm -f /tmp/wine-mono-${WINE_MONO_VERSION}-x86.tar.xz \
&& curl -sSfLo /tmp/dotnet-sdk-${DOTNET_VERSION}-win-x86.exe ${DOTNET_DOWNLOAD_URL} \
&& xvfb-run sh -c "wineboot --init && wine /tmp/dotnet-sdk-${DOTNET_VERSION}-win-x86.exe /q /norestart" \
&& rm -f /tmp/dotnet-sdk-${DOTNET_VERSION}-win-x86.exe \
&& dotnet tool install --global wix && wine wix.exe --version \
&& wix extension add -g WixToolset.Util.wixext \
&& wix extension add -g WixToolset.UI.wixext

0 comments on commit 2fa5b00

Please sign in to comment.