Skip to content

Allow Kptfile pipeline functions to reference config by resource name#4178

Open
mansoor17syed wants to merge 1 commit intokptdev:mainfrom
mansoor17syed:issue_3515
Open

Allow Kptfile pipeline functions to reference config by resource name#4178
mansoor17syed wants to merge 1 commit intokptdev:mainfrom
mansoor17syed:issue_3515

Conversation

@mansoor17syed
Copy link

@mansoor17syed mansoor17syed commented Dec 31, 2024

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.

@CsatariGergely CsatariGergely changed the title fix for #3515 Allowing Kptfile pipeline functions to be referenced by… Allow Kptfile pipeline functions to reference config by resource name Feb 11, 2026
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