Skip to content

Instantly share code, notes, and snippets.

@vnugent
Last active October 31, 2017 15:54
Show Gist options
  • Save vnugent/85f7b734cbde20f9ff84933382e17678 to your computer and use it in GitHub Desktop.
Save vnugent/85f7b734cbde20f9ff84933382e17678 to your computer and use it in GitHub Desktop.
import yaml
import sys
myParam = {
"description": "Queue size parameter for the collector",
"displayName": "Jaeger Collector Queue Size",
"name": "COLLECTOR_QUEUE_SIZE",
"required": False,
"value": "300000"
}
myCommand = "--collector.queue-size=${COLLECTOR_QUEUE_SIZE}"
f = sys.stdin
template = yaml.load(f)
params = template['parameters']
params.append(myParam)
objects = template['objects']
collectorDeployments = [x for x in objects if x['metadata']['labels']['jaeger-infra']=='collector-deployment']
if len(collectorDeployments) > 1:
print "Found more than one 'jaeger-infra==collector-deployment'"
sys.exit(1)
# assuming 1 container per pod
commands = collectorDeployments[0]['spec']['template']['spec']['containers'][0]['command']
commands.append(myCommand)
#print yaml.dump(commands, default_flow_style=False)
print yaml.dump(template, default_flow_style=False)
sys.exit(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment