kpt
kpt copied to clipboard
fix for #3515 Allowing Kptfile pipeline functions to be referenced by…
… config by resource name
Description
Add support for referencing existing resources in the package as function configs. This allows users to reference existing resources (like ConfigMaps) in their package as function configurations instead of duplicating the configuration in the Kptfile.
Motivation
Currently, function configurations can only be specified using configPath or configMap. This requires users to either maintain separate configuration files or duplicate configurations in the Kptfile. By allowing references to existing resources, we can:
- Reduce configuration duplication
- Improve maintainability
- Allow reuse of existing resources as function configurations
Changes
- Add
ResourceReferencetype inpkg/api/kptfile/v1/types.go - Add validation for resource references in
pkg/api/kptfile/v1/validation.go - Add test cases for resource reference validation in
pkg/api/kptfile/v1/validation_test.go
Testing
- Added unit tests for validation
- Tested with existing ConfigMap resources
- Verified error handling for invalid configurations
Fixes #3515