From bb2750c736eb544c12732014230509f1dd432eca Mon Sep 17 00:00:00 2001 From: hc-github-team-consul-core Date: Tue, 19 Sep 2023 14:29:37 -0400 Subject: [PATCH] Backport of docs: Fix HCL, JSON, and YAML syntax errors into release/1.15.x (#18890) docs: Fix HCL, JSON, and YAML syntax errors (#18879) This commit fixes syntax errors in HCL, JSON, and YAML example configurations. In some cases, it replaces the code example with the proper format for the code block. Also fixes HCL formatting and misc opportunistic updates to codeblock. Co-authored-by: Blake Covarrubias Co-authored-by: Tu Nguyen --- .../docs/connect/transparent-proxy.mdx | 39 ++++++++----------- website/content/docs/nia/cli/task.mdx | 2 +- website/content/docs/nia/configuration.mdx | 2 +- 3 files changed, 19 insertions(+), 24 deletions(-) diff --git a/website/content/docs/connect/transparent-proxy.mdx b/website/content/docs/connect/transparent-proxy.mdx index 59a00e6507..b24da63b77 100644 --- a/website/content/docs/connect/transparent-proxy.mdx +++ b/website/content/docs/connect/transparent-proxy.mdx @@ -71,8 +71,8 @@ connectInject: Apply the `consul.hashicorp.com/transparent-proxy=true` label to enable transparent proxy for a Kubernetes namespace. The label overrides the `connectInject.transparentProxy.defaultEnabled` Helm value and defines the default behavior of Pods in the namespace. The following example enables transparent proxy for Pods in the `my-app` namespace: -```bash -kubectl label namespaces my-app "consul.hashicorp.com/transparent-proxy=true" +```shell-session +$ kubectl label namespaces my-app "consul.hashicorp.com/transparent-proxy=true" ``` #### Individual service @@ -149,12 +149,11 @@ The [`consul.hashicorp.com/transparent-proxy-exclude-inbound-ports`](/consul/doc ```yaml -"metadata": { - "annotations": { - "consul.hashicorp.com/transparent-proxy-exclude-inbound-ports" : "8200, 8201” - } -} +metadata: + annotations: + consul.hashicorp.com/transparent-proxy-exclude-inbound-ports: "8200, 8201" ``` + #### Exclude outbound ports @@ -164,11 +163,9 @@ The [`consul.hashicorp.com/transparent-proxy-exclude-outbound-ports`](/consul/do ```yaml -"metadata": { - "annotations": { - "consul.hashicorp.com/transparent-proxy-exclude-outbound-ports" : "8200, 8201” - } -} +metadata: + annotations": + consul.hashicorp.com/transparent-proxy-exclude-outbound-ports: "8200, 8201" ``` @@ -182,11 +179,9 @@ In the following example, services in the `3.3.3.3/24` IP range are not redirect ```yaml -"metadata": { - "annotations": { - "consul.hashicorp.com/transparent-proxy-exclude-outbound-cidrs" : "3.3.3.3,3.3.3.3/24" - } -} +metadata: + annotations: + consul.hashicorp.com/transparent-proxy-exclude-outbound-cidrs: "3.3.3.3,3.3.3.3/24" ``` @@ -199,9 +194,9 @@ In the following example, services with the IDs `4444 ` and `44444 ` are not red ```yaml -"metadata": { - "annotations": { - "consul.hashicorp.com/transparent-proxy-exclude-uids" : "4444,44444” +metadata: + annotations: + consul.hashicorp.com/transparent-proxy-exclude-uids: "4444,44444" } } ``` @@ -229,7 +224,7 @@ then you must configure services in one Kubernetes cluster to explicitly dial a The following example configures the service to dial an upstream service called `my-service` in datacenter `dc2` on port `1234`: ```yaml - "consul.hashicorp.com/connect-service-upstreams": "my-service:1234:dc2" +consul.hashicorp.com/connect-service-upstreams: "my-service:1234:dc2" ``` If your Consul cluster is deployed to a [single datacenter spanning multiple Kubernetes clusters](/consul/docs/k8s/deployment-configurations/single-dc-multi-k8s), @@ -238,7 +233,7 @@ then you must configure services in one Kubernetes cluster to explicitly dial a The following example configures the service to dial an upstream service called `my-service` in another Kubernetes cluster on port `1234`: ```yaml -"consul.hashicorp.com/connect-service-upstreams": "my-service:1234" +consul.hashicorp.com/connect-service-upstreams: "my-service:1234" ``` You do not need to configure services to explicitly dial upstream services if your Consul clusters are connected with a [peering connection](/consul/docs/connect/cluster-peering). diff --git a/website/content/docs/nia/cli/task.mdx b/website/content/docs/nia/cli/task.mdx index ea10591848..d5ead540cc 100644 --- a/website/content/docs/nia/cli/task.mdx +++ b/website/content/docs/nia/cli/task.mdx @@ -34,7 +34,7 @@ task_example.hcl: task { name = "task_a" description = "" - enabled = true, + enabled = true providers = [] module = "org/example/module" version = "1.0.0" diff --git a/website/content/docs/nia/configuration.mdx b/website/content/docs/nia/configuration.mdx index bd67ef5c07..360de85936 100644 --- a/website/content/docs/nia/configuration.mdx +++ b/website/content/docs/nia/configuration.mdx @@ -277,7 +277,7 @@ A `task` block configures which task to execute in automation. Use the `conditi task { name = "taskA" description = "" - enabled = true, + enabled = true providers = [] module = "org/example/module" version = "1.0.0"