strangelove-ventures / cosmos-operator

Cosmos Operator is a kubernetes operator for managing cosmos nodes
Apache License 2.0
75 stars 18 forks source link

Log level flag error when set `logLevel: info` #422

Closed hakuno2000 closed 2 months ago

hakuno2000 commented 2 months ago

In my yaml file, when I set logLevel: info like below

  chain:
    network: mainnet
    chainID: injective-1
    binary: injectived
    homeDir: .injective
    skipInvariants: true
    genesisURL: "https://snapshots.polkachu.com/genesis/injective/genesis.json"
    snapshotURL: "https://snapshots.polkachu.com/snapshots/injective/injective_73552556.tar.lz4"
    logLevel: info
    logFormat: json

then after deploy, I got error log from pod while pod was initing

kubectl logs pod/injective-mainnet-0
Defaulted container "node" out of: node, healthcheck, clean-init (init), chain-init (init), genesis-init (init), addrbook-init (init), config-merge (init), snapshot-restore (init), version-check (init)
Error: unknown flag: --log_level
Usage:
  injectived start [flags]

Seem like logLevel field was translated to flag --log_level instead of --log-level Also logFormat was translated to flag --log_format

agouin commented 2 months ago

Instead of setting those values on the chain spec, can you try the additionalStartArgs?

E.g.:

spec:
  chain:
# ...
    additionalStartArgs:
      - --log-level
      - info
      - --log-format
      - json
# ...
hakuno2000 commented 2 months ago

Thank you, it's working normally now