Current Behavior:
Meshkit currently lacks a utility to recursively sanitize configuration maps within pattern designs. If a user accidentally leaves trailing whitespace in a string value or map key, those spaces are left intact in the design. When downstream serialization libraries (like yaml.v3) export these designs to Kubernetes manifests, they are forced by the YAML specification to preserve the spaces by wrapping the fields in single quotes (e.g., 'storage ': 1Gi or name: 'test-volume '), which breaks Kubernetes validation.
Desired Behavior:
Provide a robust utility function (SanitizePattern) that traverses a component's Configuration map and recursively trims leading and trailing whitespace from all string keys and string values. This utility must be strictly type-safe—passing non-string types (like bool, int, float, and nil) through unchanged to guarantee it does not corrupt schema data.
Screenshots/Logs
Environment
- Host OS: Mac Linux Windows
- Platform: Docker or Kubernetes
- Meshery Server Version: stable-v
- Meshery Client Version: stable-v
Current Behavior:
Meshkit currently lacks a utility to recursively sanitize configuration maps within pattern designs. If a user accidentally leaves trailing whitespace in a string value or map key, those spaces are left intact in the design. When downstream serialization libraries (like
yaml.v3) export these designs to Kubernetes manifests, they are forced by the YAML specification to preserve the spaces by wrapping the fields in single quotes (e.g.,'storage ': 1Giorname: 'test-volume '), which breaks Kubernetes validation.Desired Behavior:
Provide a robust utility function (
SanitizePattern) that traverses a component'sConfigurationmap and recursively trims leading and trailing whitespace from all string keys and string values. This utility must be strictly type-safe—passing non-string types (likebool,int,float, andnil) through unchanged to guarantee it does not corrupt schema data.Screenshots/Logs
Environment
Contributor Guides and Handbook