Skip to content

Commit 166aece

Browse files
authored
fix: embedding structs related to validationrule.Interface (#135)
## 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 <[email protected]>
1 parent 58a1f50 commit 166aece

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

api/v1alpha1/maasvalidator_types.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ type Auth struct {
5656

5757
// ImageRule defines a rule for validating one or more OS images
5858
type ImageRule struct {
59-
validationrule.ManuallyNamed `json:"-"`
59+
validationrule.ManuallyNamed `json:",inline"`
6060

6161
// Unique name for the rule
6262
RuleName string `json:"name" yaml:"name"`
@@ -86,7 +86,7 @@ type Image struct {
8686

8787
// InternalDNSRule provides rules for the internal DNS server
8888
type InternalDNSRule struct {
89-
validationrule.AutomaticallyNamed `json:"-"`
89+
validationrule.AutomaticallyNamed `json:",inline"`
9090

9191
// The domain name for the internal DNS server
9292
MaasDomain string `json:"maasDomain" yaml:"maasDomain"`
@@ -121,7 +121,7 @@ type DNSRecord struct {
121121

122122
// UpstreamDNSRule provides rules for validating the external DNS server
123123
type UpstreamDNSRule struct {
124-
validationrule.ManuallyNamed `json:"-"`
124+
validationrule.ManuallyNamed `json:",inline"`
125125

126126
// Unique name for the rule
127127
RuleName string `json:"name" yaml:"name"`
@@ -143,7 +143,7 @@ func (r *UpstreamDNSRule) SetName(name string) {
143143

144144
// ResourceAvailabilityRule provides rules for validating resource availability
145145
type ResourceAvailabilityRule struct {
146-
validationrule.ManuallyNamed `json:"-"`
146+
validationrule.ManuallyNamed `json:",inline"`
147147

148148
// Unique name for the rule
149149
RuleName string `json:"name" yaml:"name"`

0 commit comments

Comments
 (0)