Skip to content

Commit

Permalink
fix(graph-network-indexer): update indexerAgent cli to handle duplica…
Browse files Browse the repository at this point in the history
…te (#439)
  • Loading branch information
calinah authored Dec 21, 2024
1 parent d1c42b3 commit c6145d0
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 29 deletions.
2 changes: 1 addition & 1 deletion charts/graph-network-indexer/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.5.12
version: 0.5.13

# The appVersion field is intentionally left empty. Component versions are managed separately
# and can be found in the values.yaml file or individual component configurations.
Expand Down
2 changes: 1 addition & 1 deletion charts/graph-network-indexer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Deploy and scale the [Graph Network Indexer](https://github.com/graphprotocol/indexer) components inside Kubernetes with ease

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) ![Version: 0.5.12](https://img.shields.io/badge/Version-0.5.12-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) ![Version: 0.5.13](https://img.shields.io/badge/Version-0.5.13-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

## Introduction

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,44 @@
{{- $componentName := "agent" }}
{{- $componentLabel := include "graph-network-indexer.componentLabelFor" $componentName }}

{{/* Compute command line arguments */}}
{{- $args := dict }}
{{/* Populate base arguments */}}
{{- $_ := set $args "graph-node-query-endpoint" (dict "value" $values.config.graph_node.query_url) }}
{{- $_ := set $args "graph-node-status-endpoint" (dict "value" $values.config.graph_node.status_url) }}
{{- $_ := set $args "indexer-address" (dict "value" $values.config.indexer.indexer_address "quote" true) }}

{{/* Add network subgraph configs if they exist */}}
{{- with (index $values.config "subgraphs.network") }}
{{- if hasKey . "query_url" }}
{{- $_ := set $args "network-subgraph-endpoint" (dict "value" .query_url "quote" true) }}
{{- end }}
{{- if hasKey . "deployment_id" }}
{{- $_ := set $args "network-subgraph-deployment" (dict "value" .deployment_id "quote" true) }}
{{- end }}
{{- end }}

{{/* Add escrow subgraph configs if they exist */}}
{{- with (index $values.config "subgraphs.escrow") }}
{{- if hasKey . "query_url" }}
{{- $_ := set $args "tap-subgraph-endpoint" (dict "value" .query_url "quote" true) }}
{{- end }}
{{- end }}

{{/* Add postgres configs */}}
{{- $_ := set $args "postgres-database" (dict "value" $values.postgresConfig.database) }}
{{- $_ := set $args "postgres-host" (dict "value" $values.postgresConfig.host) }}
{{- $_ := set $args "postgres-port" (dict "value" $values.postgresConfig.port) }}

{{/* Merge in indexerAgent.config values */}}
{{- with $.Values.indexerAgent.config }}
{{- range $key, $val := . }}
{{- if not (kindIs "invalid" $val) }}
{{- $_ := set $args $key (dict "value" $val) }}
{{- end }}
{{- end }}
{{- end }}

{{/* START StatefulSet */}}
---
apiVersion: apps/v1
Expand Down Expand Up @@ -66,33 +104,10 @@ spec:
name: {{ $val.secretName | quote }}
key: {{ $val.key | quote }}
{{- end }}
{{- end }}
{{- end }}
args:
- --graph-node-query-endpoint={{ $values.config.graph_node.query_url }}
- --graph-node-status-endpoint={{ $values.config.graph_node.status_url }}
- --indexer-address={{ $values.config.indexer.indexer_address | quote }}
{{- with (index $values.config "subgraphs.network") }}
{{- if hasKey . "query_url" }}
- --network-subgraph-endpoint={{ .query_url | quote }}
{{- end }}
{{- if hasKey . "deployment_id" }}
- --network-subgraph-deployment={{ .deployment_id | quote }}
{{- end }}
{{- end }}
{{- with (index $values.config "subgraphs.escrow") }}
{{- if hasKey . "query_url" }}
- --tap-subgraph-endpoint={{ .query_url | quote }}
{{- end }}
{{- end }}
- --postgres-database={{ $values.postgresConfig.database }}
- --postgres-host={{ $values.postgresConfig.host }}
- --postgres-port={{ $values.postgresConfig.port }}
{{- with $.Values.indexerAgent.config }}
{{- range $key, $val := .}}
{{- if not (kindIs "invalid" $val) }}
- --{{ $key }}={{ $val }}
{{- end }}
{{- end }}
{{- range $key, $val := $args }}
- --{{ $key }}={{ if $val.quote }}{{ printf "%q" $val.value }}{{ else }}{{ $val.value }}{{ end }}
{{- end }}
{{- with $values.extraArgs }}
{{- toYaml (. | default list) | nindent 12 }}
Expand Down
2 changes: 1 addition & 1 deletion charts/graph-network-indexer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ indexerAgent:
tag: "v0.21.11"

# -- Config to be supplied as CLI arguments, specified using YAML keys to allow overriding
config:
config:
indexer-management-port: 8000
ethereum: null
# -- Name of the network that you have specified a node URL for in `ethereum`
Expand Down

0 comments on commit c6145d0

Please sign in to comment.