File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,3 +61,19 @@ ngts-generate:
6161 helm_chart_source_dir=deploy/charts/discovery-agent
6262
6363shared_generate_targets += ngts-generate
64+
65+ .PHONY : list-discovery-resources
66+ # # Dump all discovery-agent k8s-dynamic resource types to a markdown list
67+ # # @category NGTS Discovery Agent
68+ list-discovery-resources : $(NEEDS_HELM ) $(NEEDS_YQ )
69+ @# First, template out the chart using dummy values for the required values
70+ @# Then extract config.yaml, and extract all "k8s-dynamic" data gatherers
71+ @# Then print "- [group/]version resource" with the first letter of resource captialised in awk
72+ @$(HELM ) template discovery-agent deploy/charts/discovery-agent \
73+ --set-string config.tsgID=1234123412 \
74+ --set config.clusterName=foo | \
75+ $(YQ ) ' .data."config.yaml"' | \
76+ $(YQ ) ' .data-gatherers[] | select(.kind == "k8s-dynamic") | .config.resource-type' -o json | \
77+ jq -r ' if .group then "\(.group)/\(.version) \(.resource)" else "\(.version) \(.resource)" end' | \
78+ awk ' {$$NF = toupper(substr($$NF,1,1)) substr($$NF,2); print "- " $$0}' | \
79+ sort
You can’t perform that action at this time.
0 commit comments