-
Notifications
You must be signed in to change notification settings - Fork 7.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
toYaml removes quotes from keys which causes failure in keys with a dot #12606
Comments
This statement is what I think is happening, but it may not be exactly like that. Don't pay too much attention to that. Actually the problem can be seen in this issue. With the complete configuration: role: Agent
service:
enabled: false
serviceHeadless:
enabled: false
customConfig:
data_dir: /vector-data-dir
api:
enabled: true
address: 127.0.0.1:8686
playground: false
sources:
kubernetes_logs:
type: kubernetes_logs
sinks:
kafka:
type: kafka
inputs:
- kubernetes_logs
bootstrap_servers: the.kafka.server:9093
topic: aprettytopic
encoding:
codec: json
sasl:
enabled: true
mechanism: PLAIN
username: user
password: pass
librdkafka_options:
"security.protocol": sasl_ssl What the chart does is to apply the filter that I mentioned before ( apiVersion: v1
data:
vector.yaml: |
api:
address: 127.0.0.1:8686
enabled: true
playground: false
data_dir: /vector-data-dir
sinks:
kafka:
bootstrap_servers: the.kafka.server:9093
encoding:
codec: json
inputs:
- kubernetes_logs
librdkafka_options:
security.protocol: sasl_ssl
sasl:
enabled: true
mechanism: PLAIN
username: user
password: pass
topic: aprettytopic
type: kafka
sources:
kubernetes_logs:
type: kubernetes_logs
kind: ConfigMap
metadata:
annotations:
meta.helm.sh/release-name: vector
meta.helm.sh/release-namespace: monitoring
creationTimestamp: "2023-11-27T10:52:37Z"
labels:
app.kubernetes.io/component: Agent
app.kubernetes.io/instance: vector
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: vector
app.kubernetes.io/version: 0.34.1-distroless-libc
helm.sh/chart: vector-0.29.0
name: vector
namespace: monitoring
resourceVersion: "314255883"
uid: anuuid Which removes the quotation marks from Of course, if I edit the configmap by hand and put the quotation marks around it, everything works correctly. It's not really clear to me whose problem it is. If it's in Helm for removing the quotes, if it's in the chart because it should be declared otherwise or if the problem is really that Vector should maybe pick up those extra settings from a Yaml list or a literal. |
I think this is a bug in the system which is consuming the YAML here. I'm fairly certain that e.g. I think it would be necessary to reference the Yaml spec, where is says keys with dots (".") must be quoted otherwise. You might be able to use |
@gjenkins8 I have just opened an issue in Vector, let's see if we can find a solution. Thank you very much for your help. |
(chiming in from Vector, where vectordotdev/vector#19289 prompted this issue)
To clarify this bit a bit more, the reason the librdkafka_options:
"security.protocol": sasl_ssl as {
"librdkafka_options": { "security.protocol": "sasl_ssl" }
} and not: {
"librdkafka_options": { "security": {"protocol": "sasl_ssl" } }
} |
@jszwedko -- yes, I agree. Issue here is different / I mean that:
Is valid yaml, that should also be interpreted as:
I don't believe yaml spec requires keys containing periods (".") to be quoted. Not should any parser interpret keys with periods "as multiple keys". |
Ah, yes, I see, you are right! I was thinking of TOML. It seems like there might be something in Vector that is interpreting the |
In the end the incident has been a a series of unfortunate events, it has been solved, thank you all very much! |
I have this:
Once the filter is passed it is modified by this other one:
By removing the quotes, the final system ends up interpreting it in this way:
To reproduce simply try to use following
yaml
:With this template:
The text was updated successfully, but these errors were encountered: