Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions deploy/charts/discovery-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ The Discovery Agent connects your Kubernetes or OpenShift cluster to Palo Alto N

<!-- AUTO-GENERATED -->

#### **config.tsgID** ~ `string`
#### **config.tsgID** ~ `number,string`
> Default value:
> ```yaml
> ""
> ```

Required: The TSG (Tenant Service Group) ID to use when connecting to SCM. NB: TSG IDs are numeric, but must be treated as strings to avoid issues with YAML data types. With the Helm CLI use `--set-string`; with YAML always pass TSG IDs in double quotes.
Required: The TSG (Tenant Service Group) ID to use when connecting to SCM.


#### **config.clusterName** ~ `string`
Expand Down
19 changes: 19 additions & 0 deletions deploy/charts/discovery-agent/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,22 @@ usage through tuple/variable indirection.
{{- printf "%s" $defaultReference -}}
{{- end -}}
{{- end }}

{{/*
Because of Helm bug (https://github.com/helm/helm/issues/3001), Helm converts
int value to float64 implictly, like 2748336 becomes 2.748336e+06.
This breaks the output even when using quote to render.

Use this function when you want to get the string value only.
It handles the case when the value is string itself as well.
Parameters: is string/number

Usage: {{ include "discovery-agent.stringOrNumber" .Values.config.tsgID }}
*/}}
{{- define "discovery-agent.stringOrNumber" -}}
{{- if kindIs "string" . }}
{{- print . -}}
{{- else }}
{{- int64 . | toString -}}
{{- end -}}
{{- end -}}
2 changes: 1 addition & 1 deletion deploy/charts/discovery-agent/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ spec:
- "/etc/discovery-agent/config.yaml"
- --ngts
- --tsg-id
- {{ required "config.tsgID is required" .Values.config.tsgID | toString | quote }}
- {{ required "config.tsgID is required" .Values.config.tsgID | include "discovery-agent.stringOrNumber" | quote }}
{{- with .Values.config.serverURL }}
- --ngts-server-url
- {{ . | quote }}
Expand Down
3 changes: 1 addition & 2 deletions deploy/charts/discovery-agent/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,7 @@
},
"helm-values.config.tsgID": {
"default": "",
"description": "Required: The TSG (Tenant Service Group) ID to use when connecting to SCM. NB: TSG IDs are numeric, but must be treated as strings to avoid issues with YAML data types. With the Helm CLI use `--set-string`; with YAML always pass TSG IDs in double quotes.",
"type": "string"
"description": "Required: The TSG (Tenant Service Group) ID to use when connecting to SCM."
},
"helm-values.extraArgs": {
"default": [],
Expand Down
4 changes: 1 addition & 3 deletions deploy/charts/discovery-agent/values.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# Configuration for the Discovery Agent
config:
# Required: The TSG (Tenant Service Group) ID to use when connecting to SCM.
# NB: TSG IDs are numeric, but must be treated as strings to avoid issues with YAML data types.
# With the Helm CLI use `--set-string`; with YAML always pass TSG IDs in double quotes.
# +docs:property
# +docs:type=string
# +docs:type=number,string
tsgID: ""

# Required: A human readable name for the cluster into which the agent is being deployed.
Expand Down
Loading