From 166aece4db00b56d4857b1ed2c0118f65a5a6faa Mon Sep 17 00:00:00 2001 From: Matt Welke Date: Fri, 23 Aug 2024 00:50:52 -0400 Subject: [PATCH] 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 --- api/v1alpha1/maasvalidator_types.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/v1alpha1/maasvalidator_types.go b/api/v1alpha1/maasvalidator_types.go index b6fb663..b73e268 100644 --- a/api/v1alpha1/maasvalidator_types.go +++ b/api/v1alpha1/maasvalidator_types.go @@ -56,7 +56,7 @@ type Auth struct { // ImageRule defines a rule for validating one or more OS images type ImageRule struct { - validationrule.ManuallyNamed `json:"-"` + validationrule.ManuallyNamed `json:",inline"` // Unique name for the rule RuleName string `json:"name" yaml:"name"` @@ -86,7 +86,7 @@ type Image struct { // InternalDNSRule provides rules for the internal DNS server type InternalDNSRule struct { - validationrule.AutomaticallyNamed `json:"-"` + validationrule.AutomaticallyNamed `json:",inline"` // The domain name for the internal DNS server MaasDomain string `json:"maasDomain" yaml:"maasDomain"` @@ -121,7 +121,7 @@ type DNSRecord struct { // UpstreamDNSRule provides rules for validating the external DNS server type UpstreamDNSRule struct { - validationrule.ManuallyNamed `json:"-"` + validationrule.ManuallyNamed `json:",inline"` // Unique name for the rule RuleName string `json:"name" yaml:"name"` @@ -143,7 +143,7 @@ func (r *UpstreamDNSRule) SetName(name string) { // ResourceAvailabilityRule provides rules for validating resource availability type ResourceAvailabilityRule struct { - validationrule.ManuallyNamed `json:"-"` + validationrule.ManuallyNamed `json:",inline"` // Unique name for the rule RuleName string `json:"name" yaml:"name"`