a8m / a8m/envsubst

Support ignore and keep empty system environments

未關閉
#25 10 則留言 4 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Go
星號
907
分支
96
PR 合併指標
30 天內沒有已合併 PR

描述

e.g
I have prometheus config below which want only replace CONSUL_URL from system environment. but it will replace $1 left blank there which make __metrics_path__ not correct.
```
- job_name: 'consul'
metrics_path: '/actuator/prometheus'
consul_sd_configs:
- server: '${CONSUL_URL:-127.0.0.1:8500}'
services: [] #match all service
relabel_configs:
- source_labels: [__meta_consul_service]
target_label: job
- source_labels: [__meta_consul_service_metadata_management_context_path]
regex: "(.+)"
target_label: __metrics_path__
replacement: '$1/prometheus'
```

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

這個 issue 涉及在 envsubst 中處理 ${VAR:-default} 這類 shell 風格的預設值。查看主要 package 中的解析邏輯,可能位於 substitution 函式附近。了解目前如何比對和替換變數。目標是修改 substitution,使其忽略變數未設定但提供了預設值的模式,並保持原始文字不變。使用提供的 Prometheus 設定片段測試變更。

由索引模型根據 Issue 內容生成。

評估

領域
cli, tooling
Issue 類型
功能
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。