docs(kubernetes): Remove extra backspace from regex in example (#4905)

Remove extra backspace from regex in example

In the example, `[\\w-]` would match a literal backspace `\`, the
character `w` or a dash `-`. By removing the backspace, instead it
matches any "word character" `\w` or a dash `-`.
This commit is contained in:
Tom Fenech 2023-02-20 13:22:15 +01:00 committed by GitHub
parent 61b01dacd7
commit c8bb1bae8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -2456,7 +2456,7 @@ disabled = false
[kubernetes.context_aliases]
'dev.local.cluster.k8s' = 'dev'
'.*/openshift-cluster/.*' = 'openshift'
'gke_.*_(?P<var_cluster>[\\w-]+)' = 'gke-$var_cluster'
'gke_.*_(?P<var_cluster>[\w-]+)' = 'gke-$var_cluster'
[kubernetes.user_aliases]
'dev.local.cluster.k8s' = 'dev'
'root/.*' = 'root'
@ -2489,12 +2489,12 @@ and shortened using regular expressions:
# OpenShift contexts carry the namespace and user in the kube context: `namespace/name/user`:
'.*/openshift-cluster/.*' = 'openshift'
# Or better, to rename every OpenShift cluster at once:
'.*/(?P<var_cluster>[\\w-]+)/.*' = '$var_cluster'
'.*/(?P<var_cluster>[\w-]+)/.*' = '$var_cluster'
# Contexts from GKE, AWS and other cloud providers usually carry additional information, like the region/zone.
# The following entry matches on the GKE format (`gke_projectname_zone_cluster-name`)
# and renames every matching kube context into a more readable format (`gke-cluster-name`):
'gke_.*_(?P<var_cluster>[\\w-]+)' = 'gke-$var_cluster'
'gke_.*_(?P<var_cluster>[\w-]+)' = 'gke-$var_cluster'
```
## Line Break