@@ -36,6 +36,7 @@ const (
3636// ConfigMapReference defines a loadable reference to a configmap.
3737type ConfigMapReference struct {
3838 // +required
39+ // +kubebuilder:validation:MinLength=1
3940 Name string `json:"name"`
4041 data map [string ]string `json:"-"`
4142 loaded bool `json:"-"`
@@ -82,8 +83,10 @@ func (r *ConfigMapReference) Data() map[string]string {
8283// ConfigMapKeyReference defines a loadable reference to a configmap key.
8384type ConfigMapKeyReference struct {
8485 // +required
86+ // +kubebuilder:validation:MinLength=1
8587 Name string `json:"name"`
8688 // +optional
89+ // +kubebuilder:validation:MinLength=1
8790 Key string `json:"key,omitempty"`
8891 value string `json:"-"`
8992 loaded bool `json:"-"`
@@ -141,6 +144,7 @@ func (r *ConfigMapKeyReference) Value() string {
141144// SecretReference defines a loadable reference to a secret.
142145type SecretReference struct {
143146 // +required
147+ // +kubebuilder:validation:MinLength=1
144148 Name string `json:"name"`
145149 data map [string ][]byte `json:"-"`
146150 loaded bool `json:"-"`
@@ -187,8 +191,10 @@ func (r *SecretReference) Data() map[string][]byte {
187191// SecretKeyReference defines a loadable reference to a secret key.
188192type SecretKeyReference struct {
189193 // +required
194+ // +kubebuilder:validation:MinLength=1
190195 Name string `json:"name"`
191196 // +optional
197+ // +kubebuilder:validation:MinLength=1
192198 Key string `json:"key,omitempty"`
193199 value []byte `json:"-"`
194200 loaded bool `json:"-"`
0 commit comments