Describe the bug or feature request:
The Kptfile is the core configuration file for kpt packages. While some basic validation exists in the codebase, many fields are currently unvalidated. This can lead to confusing runtime errors later in the pipeline if a user manually writes an invalid Kptfile.
There is an existing TODO in api/kptfile/v1/validation.go around line 40 highlighting this exact missing functionality:
// TODO: validate other fields
Specific use case:
When authoring packages, users often edit the Kptfile by hand. We should audit the Kptfile struct and implement validation logic for fields that currently lack it (e.g., ensuring mutually exclusive fields aren't set simultaneously, or validating URL formats in upstream definitions). Catching these errors during standard package validation improves the developer experience significantly.
Describe the bug or feature request:
The
Kptfileis the core configuration file forkptpackages. While some basic validation exists in the codebase, many fields are currently unvalidated. This can lead to confusing runtime errors later in the pipeline if a user manually writes an invalidKptfile.There is an existing
TODOinapi/kptfile/v1/validation.goaround line 40 highlighting this exact missing functionality:// TODO: validate other fieldsSpecific use case:
When authoring packages, users often edit the Kptfile by hand. We should audit the Kptfile struct and implement validation logic for fields that currently lack it (e.g., ensuring mutually exclusive fields aren't set simultaneously, or validating URL formats in upstream definitions). Catching these errors during standard package validation improves the developer experience significantly.