Skip to content

Commit cfbcca0

Browse files
author
Matt Welke
authored
fix: embedding structs related to validationrule.Interface (#261)
## Description Noticed when trying to integrate latest plugin releases with validatorctl that tests started failing because the CRD couldn't be applied. It complained about unknown fields. This is because the json tag used when embedding the struct lacked "inline". This fixes that. Signed-off-by: Matt Welke <matt.welke@spectrocloud.com>
1 parent 834c56f commit cfbcca0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

api/v1alpha1/networkvalidator_types.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ func (r CASecretReference) Keys() []string {
109109

110110
// DNSRule defines a DNS validation rule.
111111
type DNSRule struct {
112-
validationrule.ManuallyNamed `json:"-"`
112+
validationrule.ManuallyNamed `json:",inline"`
113113

114114
// RuleName is a unique identifier for the rule in the validator. Used to ensure conditions do not overwrite each other.
115115
// +kubebuilder:validation:MaxLength=500
@@ -132,7 +132,7 @@ func (r *DNSRule) SetName(name string) {
132132

133133
// ICMPRule defines an ICMP validation rule.
134134
type ICMPRule struct {
135-
validationrule.ManuallyNamed `json:"-"`
135+
validationrule.ManuallyNamed `json:",inline"`
136136

137137
// RuleName is a unique identifier for the rule in the validator. Used to ensure conditions do not overwrite each other.
138138
// +kubebuilder:validation:MaxLength=500
@@ -154,7 +154,7 @@ func (r *ICMPRule) SetName(name string) {
154154

155155
// IPRangeRule defines an IP range validation rule.
156156
type IPRangeRule struct {
157-
validationrule.ManuallyNamed `json:"-"`
157+
validationrule.ManuallyNamed `json:",inline"`
158158

159159
// RuleName is a unique identifier for the rule in the validator. Used to ensure conditions do not overwrite each other.
160160
// +kubebuilder:validation:MaxLength=500
@@ -177,7 +177,7 @@ func (r *IPRangeRule) SetName(name string) {
177177

178178
// MTURule defines an MTU validation rule.
179179
type MTURule struct {
180-
validationrule.ManuallyNamed `json:"-"`
180+
validationrule.ManuallyNamed `json:",inline"`
181181

182182
// RuleName is a unique identifier for the rule in the validator. Used to ensure conditions do not overwrite each other.
183183
// +kubebuilder:validation:MaxLength=500
@@ -204,7 +204,7 @@ func (r *MTURule) SetName(name string) {
204204

205205
// TCPConnRule defines a TCP connection validation rule.
206206
type TCPConnRule struct {
207-
validationrule.ManuallyNamed `json:"-"`
207+
validationrule.ManuallyNamed `json:",inline"`
208208

209209
// RuleName is a unique identifier for the rule in the validator. Used to ensure conditions do not overwrite each other.
210210
// +kubebuilder:validation:MaxLength=500
@@ -233,7 +233,7 @@ func (r *TCPConnRule) SetName(name string) {
233233

234234
// HTTPFileRule defines an HTTP file rule. A unique rule must be created for each host requiring HTTP basic authentication.
235235
type HTTPFileRule struct {
236-
validationrule.ManuallyNamed `json:"-"`
236+
validationrule.ManuallyNamed `json:",inline"`
237237

238238
// RuleName is a unique identifier for the rule in the validator. Used to ensure conditions do not overwrite each other.
239239
// +kubebuilder:validation:MaxLength=500

0 commit comments

Comments
 (0)