Skip to content

Conversation

@heliapb
Copy link
Member

@heliapb heliapb commented Sep 9, 2025

Description

From issue #7870, add https://github.com/kubernetes-sigs/kube-api-linter/blob/main/docs/linters.md#maxlength

  • CHANGE (fix or feature that would cause existing functionality to not work as expected)
  • FEATURE (non-breaking change which adds functionality)
  • BUGFIX (non-breaking change which fixes an issue)
  • ENHANCEMENT (non-breaking change which improves existing functionality)
  • NONE (if none of the other choices apply. Example, tooling, build system, CI, docs, etc.)

Verification

Please check the Prometheus-Operator testing guidelines for recommendations about automated tests.

Changelog entry

Please put a one-line changelog entry below. This will be copied to the changelog file during the release process.


Signed-off-by: Hélia Barroso <helia_barroso@hotmail.com>
Copy link
Contributor

@simonpasquier simonpasquier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting limits is going to be a hard call. We should probably err on the safe side and set exceptions when unsure (though I don't know how we can tell KAL to exclude only one linter vs. all).

// Each Secret is added to the StatefulSet definition as a volume named `secret-<secret-name>`.
// The Secrets are mounted into `/etc/alertmanager/secrets/<secret-name>` in the 'alertmanager' container.
// +kubebuilder:validation:MaxItems=50
// +kubebuilder:validation:items:MaxLength=253
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that secret names can't exceed 63 chars. For the max number of secrets, I'm not sure what a reasonable limit would be TBH.

// Each ConfigMap is added to the StatefulSet definition as a volume named `configmap-<configmap-name>`.
// The ConfigMaps are mounted into `/etc/alertmanager/configmaps/<configmap-name>` in the 'alertmanager' container.
// +kubebuilder:validation:MaxItems=50
// +kubebuilder:validation:items:MaxLength=253
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Host string `json:"host"`
// Defines the host's port, it can be a literal port number or a port name.
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be more than 5.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants