Skip to content

Spec: Correct tcpListener/tcpConnector required fields #1848

@c-kruse

Description

@c-kruse

What

In skrouter.json the tcpListener and tcpConnector entity specs have their address and port attributes specified without "required": true, but the C implementation uses qd_entity_get_string for these indicating they are required by the implementation.

Inconsistencies like this make it difficult to generate go type definitions based off of the entity spec, and also causes operations with missing attributes to fall back on validations in C instead of in the initial python layer.

# required=false
[christian@toolbx skupper-router] (main)$ skmanage create --type tcpListener --name tl01 observer=auto
InternalServerErrorStatus: CError: Python: KeyError: 'port'
# required=true
[christian@toolbx skupper-router] (main *)$ skmanage create --type tcpListener --name tl01 observer=auto
BadRequestStatus: Missing required attribute 'port'

Suggestion

Explicitly mark these attributes as required in the spec.

A step further would be to purge all of the usages of "required": false from the spec in order to avoid confusion over the default required-ness of attributes. It is my best guess that confusing this was a contributing factor to this misconfiguration.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions