Skip to content

OCPBUGS-56725: Add max length validation for apiserver namedCertificates #2342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,675 changes: 1,675 additions & 0 deletions config/v1/tests/apiservers.config.openshift.io/APIServerServingCerts.yaml

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions config/v1/types_apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ type APIServerServingCerts struct {
// the defaultServingCertificate will be used.
// +optional
// +listType=atomic
// +kubebuilder:validation:MaxItems=32
NamedCertificates []APIServerNamedServingCert `json:"namedCertificates,omitempty"`
}

Expand All @@ -165,6 +166,7 @@ type APIServerNamedServingCert struct {
// Exact names trump over wildcard names. Explicit names defined here trump over extracted implicit names.
// +optional
// +listType=atomic
// +kubebuilder:validation:MaxItems=64
Names []string `json:"names,omitempty"`
// servingCertificate references a kubernetes.io/tls type secret containing the TLS cert info for serving secure traffic.
// The secret must exist in the openshift-config namespace and contain the following required fields:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ spec:
Exact names trump over wildcard names. Explicit names defined here trump over extracted implicit names.
items:
type: string
maxItems: 64
type: array
x-kubernetes-list-type: atomic
servingCertificate:
Expand All @@ -287,6 +288,7 @@ spec:
- name
type: object
type: object
maxItems: 32
type: array
x-kubernetes-list-type: atomic
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ spec:
Exact names trump over wildcard names. Explicit names defined here trump over extracted implicit names.
items:
type: string
maxItems: 64
type: array
x-kubernetes-list-type: atomic
servingCertificate:
Expand All @@ -218,6 +219,7 @@ spec:
- name
type: object
type: object
maxItems: 32
type: array
x-kubernetes-list-type: atomic
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ spec:
Exact names trump over wildcard names. Explicit names defined here trump over extracted implicit names.
items:
type: string
maxItems: 64
type: array
x-kubernetes-list-type: atomic
servingCertificate:
Expand All @@ -287,6 +288,7 @@ spec:
- name
type: object
type: object
maxItems: 32
type: array
x-kubernetes-list-type: atomic
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ spec:
Exact names trump over wildcard names. Explicit names defined here trump over extracted implicit names.
items:
type: string
maxItems: 64
type: array
x-kubernetes-list-type: atomic
servingCertificate:
Expand All @@ -287,6 +288,7 @@ spec:
- name
type: object
type: object
maxItems: 32
type: array
x-kubernetes-list-type: atomic
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ spec:
Exact names trump over wildcard names. Explicit names defined here trump over extracted implicit names.
items:
type: string
maxItems: 64
type: array
x-kubernetes-list-type: atomic
servingCertificate:
Expand All @@ -218,6 +219,7 @@ spec:
- name
type: object
type: object
maxItems: 32
type: array
x-kubernetes-list-type: atomic
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ spec:
Exact names trump over wildcard names. Explicit names defined here trump over extracted implicit names.
items:
type: string
maxItems: 64
type: array
x-kubernetes-list-type: atomic
servingCertificate:
Expand All @@ -287,6 +288,7 @@ spec:
- name
type: object
type: object
maxItems: 32
type: array
x-kubernetes-list-type: atomic
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ spec:
Exact names trump over wildcard names. Explicit names defined here trump over extracted implicit names.
items:
type: string
maxItems: 64
type: array
x-kubernetes-list-type: atomic
servingCertificate:
Expand All @@ -287,6 +288,7 @@ spec:
- name
type: object
type: object
maxItems: 32
type: array
x-kubernetes-list-type: atomic
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ spec:
Exact names trump over wildcard names. Explicit names defined here trump over extracted implicit names.
items:
type: string
maxItems: 64
type: array
x-kubernetes-list-type: atomic
servingCertificate:
Expand All @@ -218,6 +219,7 @@ spec:
- name
type: object
type: object
maxItems: 32
type: array
x-kubernetes-list-type: atomic
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ spec:
Exact names trump over wildcard names. Explicit names defined here trump over extracted implicit names.
items:
type: string
maxItems: 64
type: array
x-kubernetes-list-type: atomic
servingCertificate:
Expand All @@ -287,6 +288,7 @@ spec:
- name
type: object
type: object
maxItems: 32
type: array
x-kubernetes-list-type: atomic
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ spec:
Exact names trump over wildcard names. Explicit names defined here trump over extracted implicit names.
items:
type: string
maxItems: 64
type: array
x-kubernetes-list-type: atomic
servingCertificate:
Expand All @@ -287,6 +288,7 @@ spec:
- name
type: object
type: object
maxItems: 32
type: array
x-kubernetes-list-type: atomic
type: object
Expand Down