Skip to content

Conversation

@mansoor17syed
Copy link

… 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 ResourceReference type in pkg/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

…ced by config by resource name

Signed-off-by: mansoora <syed.mansoor_a@nokia.com>
@liamfallon
Copy link
Contributor

This looks like a good addition, We need to find time to pull it down and try it out. Also we need to add an e2e test for this.

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.

Allow Kptfile pipeline functions to reference config by resource name

2 participants