Skip to content

Conversation

@ljluestc
Copy link

@ljluestc ljluestc commented Dec 1, 2025

This PR introduces a new configuration file format (v1alpha6) that replaces the confusing nodeFilters syntax with explicit node definitions. The new format uses a nodes array where each node configuration is self-contained, making configurations more readable and easier to understand.

Key Changes:

  • New v1alpha6 API version with explicit node definitions
  • Replaced servers/agents counts with nodes array containing role, name, and replicas
  • Moved per-node configurations (volumes, ports, env vars, labels, files) from global nodeFilters to individual node configs
  • Added migration support from v1alpha5 to v1alpha6
  • New transform logic for the v1alpha6 format
  • JSON schema validation for the new format

Breaking Changes

  • This is a new API version (v1alpha6), so existing v1alpha5 configs will continue to work
  • Migration is handled automatically when v1alpha5 configs are loaded
  • The old format will be deprecated in a future release

Migration Path

  • Existing v1alpha5 configurations are automatically migrated to v1alpha6
  • Migration converts servers/agents counts to explicit node definitions
  • nodeFilters are resolved and applied to specific nodes during migration
  • All existing functionality is preserved

Internal Changes (pkg/)

  • pkg/config/v1alpha6/: New package containing v1alpha6 configuration types, migration logic, and JSON schema
  • pkg/config/transform_v1alpha6.go: New transform logic for handling v1alpha6 configurations
  • The changes are primarily internal to the configuration system and don't affect the CLI directly
  • Existing CLI commands continue to work with both old and new configuration formats

Future Considerations

  • This change paves the way for more advanced node configuration options
  • The explicit node model makes it easier to add node-specific features in the future
  • Consider deprecating v1alpha5 in a future major release

Files Added/Modified

  • pkg/config/v1alpha6/types.go - New configuration types
  • pkg/config/v1alpha6/migrations.go - Migration logic from v1alpha5
  • pkg/config/v1alpha6/schema.json - JSON schema for validation
  • pkg/config/transform_v1alpha6.go - Transform logic for new format
  • example-v1alpha6.yaml - Example configuration demonstrating new syntax

Testing

  • Migration logic tested with various v1alpha5 configuration patterns
  • New transform logic handles all node configuration options
  • JSON schema validates new configuration format correctly
  • Backward compatibility maintained for existing configurations

…k3d-io#1078)

- Introduce new v1alpha6 config format with explicit node definitions
- Replace servers/agents count with nodes array containing role, name, replicas
- Move volume, port, env, label, and file configurations from global nodeFilters to individual node configs
- Add migration support from v1alpha5 to v1alpha6
- Add new transform logic for v1alpha6 format
- Include JSON schema validation for new format
- Add example configuration demonstrating new syntax

This change improves readability and reduces confusion around nodeFilter syntax
by making node configurations explicit and self-contained.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant