strangelove-ventures / cosmos-operator

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

fix: allow long annotations #421

Open scirner22 opened 3 months ago

scirner22 commented 3 months ago

Problem

With the following podTemplate:

podTemplate:
  metadata:
    annotations:
      ad.datadoghq.com/node.checks: |
        {
          "openmetrics": {
            "init_config": {},
            "instances": [
              {
                "histogram_buckets_as_distributions": true,
                "collect_counters_with_distributions": false,
                "openmetrics_endpoint": "http://%%host%%:26660/metrics",
                "namespace": "chain",
                "metrics": [
                  "cometbft_consensus_height",
                  "cometbft_p2p_peers",
                  "cometbft_consensus_step_duration_seconds",
                  "cometbft_state_block_processing_time",
                  "go_gc_duration_seconds"
                ]
              }
            ]
          }
        }

A pod is produced like so:

apiVersion: v1
kind: Pod
metadata:
  annotations:
    ad.datadoghq.com/node.checks: |
      {
        "openmetrics": {
          "init_"
              ]
            }
          ]
        }
      }

Solution

Removing the trimming functionality related to annotations. Based on the k8s docs It seems like annotation values are not limited in length at all.