Skip to content

Commit

Permalink
fix(MeshService): namespace on example (#1952)
Browse files Browse the repository at this point in the history
* fix(MeshService): namespace on example
* feat(policy_yaml): add namespace param for namespaced policies/resources

Signed-off-by: Mike Beaumont <mjboamail@gmail.com>
  • Loading branch information
michaelbeaumont authored Oct 9, 2024
1 parent 3135091 commit 6b8f780
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/_src/networking/meshservice.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ the analog of a Kubernetes `Service`.

A basic example follows to illustrate the structure:

{% policy_yaml meshservice_example %}
{% policy_yaml meshservice_example namespace=kuma-demo %}
```yaml
type: MeshService
name: redis
Expand All @@ -29,7 +29,7 @@ spec:
selector:
dataplaneTags: # tags in Dataplane object, see below
app: redis
k8s.kuma.io/namespace: redis-system # added automatically
k8s.kuma.io/namespace: kuma-demo # added automatically
ports:
- port: 6739
targetPort: 6739
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def render(context)
# remove ```yaml header and ``` footer and read each document one by one
content = content.gsub(/`{3}yaml\n/, '').gsub(/`{3}/, '')
site_data = context.registers[:site].config
mesh_namespace = site_data['mesh_namespace']
mesh_namespace = @params["namespace"] || site_data['mesh_namespace']
uni_content = ""
kube_content = ""
YAML.load_stream(content) do |yaml_data|
Expand Down

0 comments on commit 6b8f780

Please sign in to comment.