Skip to content

Instantly share code, notes, and snippets.

@hash-d
Last active September 30, 2025 18:25
Show Gist options
  • Save hash-d/67077ba0736f4662ff75093beda7116a to your computer and use it in GitHub Desktop.
Save hash-d/67077ba0736f4662ff75093beda7116a to your computer and use it in GitHub Desktop.
Bad resource names - silent failures

#79: skupper.v2.resource fails silently for invalid names

skupperproject/skupper-ansible#79

On this test, there is a Listener named asdf-Listener.

That name, containing an uppercase letter, is considered invalid by is_valid_name() on plugins/module_utils/args.py.

There is a series of tests on dump() at plugins/module_utils/resource.py which will simply continue in case of unexpected conditions, some of which use is_valid_name().

To get the test to pass, change the listener name to asdf-listener (lower case 'l')

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
---
- name: Test
hosts: all
gather_facts: no
tasks:
- name: Create site
skupper.v2.resource:
platform: "{{ skupper_platform }}"
namespace: asdf
def:
apiVersion: skupper.io/v2alpha1
kind: Site
metadata:
name: asdf
# spec:
- name: Start the site
skupper.v2.system:
action: start
namespace: asdf
platform: "{{ skupper_platform }}"
- name: Create a Listener
skupper.v2.resource:
platform: "{{ skupper_platform }}"
namespace: asdf
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 }}"
namespace: asdf
state: latest
def:
apiVersion: skupper.io/v2alpha1
kind: Connector
metadata:
name: asdf-connector
namespace: asdf
spec:
routingKey: asdf
port: 9192
host: localhost
- name: Reload the site
skupper.v2.system:
action: reload
namespace: asdf
platform: "{{ skupper_platform }}"
- name: Wait for 9191 to be opened
ansible.builtin.wait_for:
port: 9191
state: started
timeout: 60
- name: Pause
ansible.builtin.pause:
- name: Teardown
skupper.v2.system:
namespace: asdf
platform: "{{ skupper_platform }}"
action: stop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment