Skip to content

Commit 549bc33

Browse files
author
Matt Welke
authored
fix: embedding structs related to validationrule.Interface (#476)
## 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 6ede68f commit 549bc33

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

api/v1alpha1/awsvalidator_types.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ type AwsSTSAuth struct {
9999
// Each AmiRule is intended to match a single AMI, as an AmiRule is considered successful if at least one AMI is found.
100100
// Refer to https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeImages.html for more information.
101101
type AmiRule struct {
102-
validationrule.ManuallyNamed `json:"-"`
102+
validationrule.ManuallyNamed `json:",inline"`
103103

104104
RuleName string `json:"name" yaml:"name"`
105105
AmiIDs []string `json:"amiIds,omitempty" yaml:"amiIds,omitempty"`
@@ -129,7 +129,7 @@ type Filter struct {
129129

130130
// IamRoleRule compares the IAM permissions associated with an IAM role against an expected permission set.
131131
type IamRoleRule struct {
132-
validationrule.AutomaticallyNamed `json:"-"`
132+
validationrule.AutomaticallyNamed `json:",inline"`
133133

134134
IamRoleName string `json:"iamRoleName" yaml:"iamRoleName"`
135135
Policies []PolicyDocument `json:"iamPolicies" yaml:"iamPolicies"`
@@ -149,7 +149,7 @@ func (r IamRoleRule) IAMPolicies() []PolicyDocument {
149149

150150
// IamUserRule compares the IAM permissions associated with an IAM user against an expected permission set.
151151
type IamUserRule struct {
152-
validationrule.AutomaticallyNamed `json:"-"`
152+
validationrule.AutomaticallyNamed `json:",inline"`
153153

154154
IamUserName string `json:"iamUserName" yaml:"iamUserName"`
155155
Policies []PolicyDocument `json:"iamPolicies" yaml:"iamPolicies"`
@@ -169,7 +169,7 @@ func (r IamUserRule) IAMPolicies() []PolicyDocument {
169169

170170
// IamGroupRule compares the IAM permissions associated with an IAM group against an expected permission set.
171171
type IamGroupRule struct {
172-
validationrule.AutomaticallyNamed `json:"-"`
172+
validationrule.AutomaticallyNamed `json:",inline"`
173173

174174
IamGroupName string `json:"iamGroupName" yaml:"iamGroupName"`
175175
Policies []PolicyDocument `json:"iamPolicies" yaml:"iamPolicies"`
@@ -189,7 +189,7 @@ func (r IamGroupRule) IAMPolicies() []PolicyDocument {
189189

190190
// IamPolicyRule compares the IAM permissions associated with an IAM policy against an expected permission set.
191191
type IamPolicyRule struct {
192-
validationrule.AutomaticallyNamed `json:"-"`
192+
validationrule.AutomaticallyNamed `json:",inline"`
193193

194194
IamPolicyARN string `json:"iamPolicyArn" yaml:"iamPolicyArn"`
195195
Policies []PolicyDocument `json:"iamPolicies" yaml:"iamPolicies"`
@@ -240,7 +240,7 @@ func (c Condition) String() string {
240240

241241
// ServiceQuotaRule ensures that AWS service quotas are within a particular threshold.
242242
type ServiceQuotaRule struct {
243-
validationrule.ManuallyNamed `json:"-"`
243+
validationrule.ManuallyNamed `json:",inline"`
244244

245245
RuleName string `json:"name" yaml:"name"`
246246
Region string `json:"region" yaml:"region"`
@@ -268,7 +268,7 @@ type ServiceQuota struct {
268268

269269
// TagRule ensures that the tags associated with a particular AWS resource match an expected tag set.
270270
type TagRule struct {
271-
validationrule.ManuallyNamed `json:"-"`
271+
validationrule.ManuallyNamed `json:",inline"`
272272

273273
RuleName string `json:"name" yaml:"name"`
274274
Key string `json:"key" yaml:"key"`

0 commit comments

Comments
 (0)