Skip to content

Conversation

@krishagarwal278
Copy link
Contributor

@krishagarwal278 krishagarwal278 commented Nov 5, 2025

Description

This PR introduces a new enums linter to enforce best practices for enumerated fields in Kubernetes APIs.

The new linter, enums, achieves the following:

  • Documents Enum Fields: Enforces use of type aliases with +enum markers instead of plain strings. Ensures enum values are explicitly documented in OpenAPI schemas with clear justifications for their purpose.
  • Prevents Regressions: Validates that enum fields match documented patterns. Prevents undocumented or accidental changes to enum naming conventions and type definitions.
  • Improves API Quality: Enforces PascalCase naming for enum values (e.g., "PhasePending"). Ensures thoughtful consideration for enum field design, improving schema validation and generated client type safety.
  • The linter is disabled by default and supports an allowlist for special cases like command-line tool names.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 5, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: krishagarwal278
Once this PR has been reviewed and has the lgtm label, please assign joelspeed for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants