Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: YAML rendering of structs embedded in rules #143

Merged
merged 1 commit into from
Aug 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions api/v1alpha1/maasvalidator_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ type Auth struct {

// ImageRule defines a rule for validating one or more OS images
type ImageRule struct {
validationrule.ManuallyNamed `json:",inline"`
validationrule.ManuallyNamed `json:",inline" yaml:",omitempty"`

// Unique name for the rule
RuleName string `json:"name" yaml:"name"`
Expand Down Expand Up @@ -89,7 +89,7 @@ type Image struct {

// InternalDNSRule provides rules for the internal DNS server
type InternalDNSRule struct {
validationrule.AutomaticallyNamed `json:",inline"`
validationrule.AutomaticallyNamed `json:",inline" yaml:",omitempty"`

// The domain name for the internal DNS server
MaasDomain string `json:"maasDomain" yaml:"maasDomain"`
Expand Down Expand Up @@ -124,7 +124,7 @@ type DNSRecord struct {

// UpstreamDNSRule provides rules for validating the external DNS server
type UpstreamDNSRule struct {
validationrule.ManuallyNamed `json:",inline"`
validationrule.ManuallyNamed `json:",inline" yaml:",omitempty"`

// Unique name for the rule
RuleName string `json:"name" yaml:"name"`
Expand All @@ -146,7 +146,7 @@ func (r *UpstreamDNSRule) SetName(name string) {

// ResourceAvailabilityRule provides rules for validating resource availability
type ResourceAvailabilityRule struct {
validationrule.ManuallyNamed `json:",inline"`
validationrule.ManuallyNamed `json:",inline" yaml:",omitempty"`

// Unique name for the rule
RuleName string `json:"name" yaml:"name"`
Expand Down