Skip to content

Instantly share code, notes, and snippets.

@hash-d
Last active September 30, 2025 20:08
Show Gist options
  • Save hash-d/35b27c16f8b4f1bc4f8b1716c3f3756d to your computer and use it in GitHub Desktop.
Save hash-d/35b27c16f8b4f1bc4f8b1716c3f3756d to your computer and use it in GitHub Desktop.
asdf

#81: skupper.v2.resources ignores def.metadata.namespace for system sites

skupperproject/skupper-ansible#81

Note that the test has listener and container on the same namespace with the same routingKey. The intention is simply to have the listener match so it opens the port.

To run the test:

ansible-playbook -i SOME_IP, ./main.yaml -e skupper_platform=podman -vv
ansible-playbook -i localhost, ./main.yaml -e skupper_platform=kubernetes -vv -e kubeconfig=$KUBECONFIG

One of the last tasks of the test is to list the resources in all namespaces. See that the 'asdf' resources end up created on the default namespace, for non-kube, whereas the kube playbook fails straight away.

[defaults]
stdout_callback = yaml
---
- name: Test
hosts: all
gather_facts: no
tasks:
- name: Create site
skupper.v2.resource:
platform: "{{ skupper_platform }}"
kubeconfig: "{{ kubeconfig | default(omit) }}"
def:
apiVersion: skupper.io/v2alpha1
kind: Site
metadata:
name: asdf
namespace: asdf
- name: Create a Listener
skupper.v2.resource:
platform: "{{ skupper_platform }}"
kubeconfig: "{{ kubeconfig | default(omit) }}"
state: latest
def:
apiVersion: skupper.io/v2alpha1
kind: Listener
metadata:
name: asdf-listener
namespace: asdf
spec:
routingKey: asdf
port: 9191
host: localhost
- name: Create a Connector
skupper.v2.resource:
platform: "{{ skupper_platform }}"
kubeconfig: "{{ kubeconfig | default(omit) }}"
state: latest
def:
apiVersion: skupper.io/v2alpha1
kind: Connector
metadata:
name: asdf-connector
namespace: asdf
spec:
routingKey: asdf
port: 9192
host: localhost
- name: Check status
ansible.builtin.shell:
cmd: "{{ item }}"
loop:
- ls ~/.local/share/skupper/namespaces/*/input/resources
failed_when: false
register: commands
when: skupper_platform != "kubernetes"
- name: Start the site
skupper.v2.system:
action: start
namespace: asdf
platform: "{{ skupper_platform }}"
when: skupper_platform != "kubernetes"
- name: Pause
ansible.builtin.pause:
when: skupper_platform != "kubernetes"
- name: Teardown
skupper.v2.system:
namespace: asdf
platform: "{{ skupper_platform }}"
action: stop
when: skupper_platform != "kubernetes"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment