Skip to content

Commit

Permalink
Jsonnet: replace null with {} (#780)
Browse files Browse the repository at this point in the history
Converting `null` or `{}` to YAML both result in `null`. But null in Jsonnnet can trip someone up that expects the value to be there. For instance when extending tempo_config they might do something like this:

```
  tempo_config+:: {
    distributor+: {
      // ...
    }
  }
```

Using +: is generally preferred because it doesn't overwrite previous values, but would not work if tempo_config.distributor is null.
  • Loading branch information
yvrhdn authored Jun 21, 2021
1 parent e446520 commit 644c81f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions operations/jsonnet/microservices/configmap.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
server: {
http_listen_port: $._config.port,
},
distributor: null,
distributor: {},
ingester: {
lifecycler: {
ring: {
replication_factor: 3,
},
},
},
compactor: null,
compactor: {},
storage: {
trace: {
blocklist_poll: '0',
Expand Down

0 comments on commit 644c81f

Please sign in to comment.