File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -238,13 +238,22 @@ type FileKeySource struct {
238238 KeyCache *v1alpha1.Duration ` json:"keyCache,omitempty"`
239239}
240240
241- // LocalObjectReferenceWithKey sepcifies as local kubernetes object
242- // with required `key` field to extract data.
241+ // LocalObjectReferenceWithKey specifies a local Kubernetes object
242+ // with a required `key` field to extract data.
243+ // +kubebuilder:validation:XValidation:message="name must be set",rule="self.name != ''"
243244type LocalObjectReferenceWithKey struct {
244- v1.LocalObjectReference
245- Key string
245+ // Inline the core LocalObjectReference so `name` sits at the same JSON level
246+ // (optional, but avoids nesting)
247+ v1.LocalObjectReference ` json:",inline"`
248+
249+ // Key must be provided and non-empty.
250+ // This makes the field required in the OpenAPI schema.
251+ // +kubebuilder:validation:MinLength=1
252+ // +kubebuilder:validation:XValidation:rule="self != ''",message="key must be non-empty"
253+ Key string ` json:"key"`
246254}
247255
256+
248257 // RemoteKeySource specifies remote JWKS configuration.
249258type RemoteKeySource struct {
250259 // URL is the JWKS endpoint, e.g. "https://issuer.example.com/.well-known/jwks.json".
You can’t perform that action at this time.
0 commit comments