Skip to content

Add missing validation logic for Kptfile fields #4735

Description

@vishnukothakapu

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions