Skip to content

Commit e7f9356

Browse files
committed
chore: add YAML tags to AWS validator spec
1 parent 68aa184 commit e7f9356

1 file changed

Lines changed: 38 additions & 38 deletions

File tree

api/v1alpha1/awsvalidator_types.go

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,26 @@ import (
2525

2626
// AwsValidatorSpec defines the desired state of AwsValidator
2727
type AwsValidatorSpec struct {
28-
Auth AwsAuth `json:"auth"`
29-
DefaultRegion string `json:"defaultRegion"`
30-
IamRoleRules []IamRoleRule `json:"iamRoleRules,omitempty"`
31-
IamUserRules []IamUserRule `json:"iamUserRules,omitempty"`
32-
IamGroupRules []IamGroupRule `json:"iamGroupRules,omitempty"`
33-
IamPolicyRules []IamPolicyRule `json:"iamPolicyRules,omitempty"`
34-
ServiceQuotaRules []ServiceQuotaRule `json:"serviceQuotaRules,omitempty"`
35-
TagRules []TagRule `json:"tagRules,omitempty"`
28+
Auth AwsAuth `json:"auth" yaml:"auth"`
29+
DefaultRegion string `json:"defaultRegion" yaml:"defaultRegion"`
30+
IamRoleRules []IamRoleRule `json:"iamRoleRules,omitempty" yaml:"iamRoleRules,omitempty"`
31+
IamUserRules []IamUserRule `json:"iamUserRules,omitempty" yaml:"iamUserRules,omitempty"`
32+
IamGroupRules []IamGroupRule `json:"iamGroupRules,omitempty" yaml:"iamGroupRules,omitempty"`
33+
IamPolicyRules []IamPolicyRule `json:"iamPolicyRules,omitempty" yaml:"iamPolicyRules,omitempty"`
34+
ServiceQuotaRules []ServiceQuotaRule `json:"serviceQuotaRules,omitempty" yaml:"serviceQuotaRules,omitempty"`
35+
TagRules []TagRule `json:"tagRules,omitempty" yaml:"tagRules,omitempty"`
3636
}
3737

3838
type AwsAuth struct {
3939
// Option 1: lookup AWS creds from a secret
40-
SecretName string `json:"secretName,omitempty"`
40+
SecretName string `json:"secretName,omitempty" yaml:"secretName,omitempty"`
4141
// Option 2: specify a service account (EKS)
42-
ServiceAccountName string `json:"serviceAccountName,omitempty"`
42+
ServiceAccountName string `json:"serviceAccountName,omitempty" yaml:"serviceAccountName,omitempty"`
4343
}
4444

4545
type IamRoleRule struct {
46-
IamRoleName string `json:"iamRoleName"`
47-
Policies []PolicyDocument `json:"iamPolicies"`
46+
IamRoleName string `json:"iamRoleName" yaml:"iamRoleName"`
47+
Policies []PolicyDocument `json:"iamPolicies" yaml:"iamPolicies"`
4848
}
4949

5050
func (r IamRoleRule) Name() string {
@@ -56,8 +56,8 @@ func (r IamRoleRule) IAMPolicies() []PolicyDocument {
5656
}
5757

5858
type IamUserRule struct {
59-
IamUserName string `json:"iamUserName"`
60-
Policies []PolicyDocument `json:"iamPolicies"`
59+
IamUserName string `json:"iamUserName" yaml:"iamUserName"`
60+
Policies []PolicyDocument `json:"iamPolicies" yaml:"iamPolicies"`
6161
}
6262

6363
func (r IamUserRule) Name() string {
@@ -69,8 +69,8 @@ func (r IamUserRule) IAMPolicies() []PolicyDocument {
6969
}
7070

7171
type IamGroupRule struct {
72-
IamGroupName string `json:"iamGroupName"`
73-
Policies []PolicyDocument `json:"iamPolicies"`
72+
IamGroupName string `json:"iamGroupName" yaml:"iamGroupName"`
73+
Policies []PolicyDocument `json:"iamPolicies" yaml:"iamPolicies"`
7474
}
7575

7676
func (r IamGroupRule) Name() string {
@@ -82,8 +82,8 @@ func (r IamGroupRule) IAMPolicies() []PolicyDocument {
8282
}
8383

8484
type IamPolicyRule struct {
85-
IamPolicyARN string `json:"iamPolicyArn"`
86-
Policies []PolicyDocument `json:"iamPolicies"`
85+
IamPolicyARN string `json:"iamPolicyArn" yaml:"iamPolicyArn"`
86+
Policies []PolicyDocument `json:"iamPolicies" yaml:"iamPolicies"`
8787
}
8888

8989
func (r IamPolicyRule) Name() string {
@@ -95,45 +95,45 @@ func (r IamPolicyRule) IAMPolicies() []PolicyDocument {
9595
}
9696

9797
type PolicyDocument struct {
98-
Name string `json:"name"`
99-
Version string `json:"version"`
100-
Statements []StatementEntry `json:"statements"`
98+
Name string `json:"name" yaml:"name"`
99+
Version string `json:"version" yaml:"version"`
100+
Statements []StatementEntry `json:"statements" yaml:"statements"`
101101
}
102102

103103
type StatementEntry struct {
104-
Condition *Condition `json:"condition,omitempty"`
105-
Effect string `json:"effect"`
106-
Actions []string `json:"actions"`
107-
Resources []string `json:"resources"`
104+
Condition *Condition `json:"condition,omitempty" yaml:"condition,omitempty"`
105+
Effect string `json:"effect" yaml:"effect"`
106+
Actions []string `json:"actions" yaml:"actions"`
107+
Resources []string `json:"resources" yaml:"resources"`
108108
}
109109

110110
type Condition struct {
111-
Type string `json:"type"`
112-
Key string `json:"key"`
113-
Values []string `json:"values"`
111+
Type string `json:"type" yaml:"type"`
112+
Key string `json:"key" yaml:"key"`
113+
Values []string `json:"values" yaml:"values"`
114114
}
115115

116116
func (c *Condition) String() string {
117117
return fmt.Sprintf("%s: %s=%s", c.Type, c.Key, c.Values)
118118
}
119119

120120
type ServiceQuotaRule struct {
121-
Region string `json:"region"`
122-
ServiceCode string `json:"serviceCode"`
123-
ServiceQuotas []ServiceQuota `json:"serviceQuotas"`
121+
Region string `json:"region" yaml:"region"`
122+
ServiceCode string `json:"serviceCode" yaml:"serviceCode"`
123+
ServiceQuotas []ServiceQuota `json:"serviceQuotas" yaml:"serviceQuotas"`
124124
}
125125

126126
type ServiceQuota struct {
127-
Name string `json:"name"`
128-
Buffer int `json:"buffer"`
127+
Name string `json:"name" yaml:"name"`
128+
Buffer int `json:"buffer" yaml:"buffer"`
129129
}
130130

131131
type TagRule struct {
132-
Key string `json:"key"`
133-
ExpectedValue string `json:"expectedValue"`
134-
Region string `json:"region"`
135-
ResourceType string `json:"resourceType"`
136-
ARNs []string `json:"arns"`
132+
Key string `json:"key" yaml:"key"`
133+
ExpectedValue string `json:"expectedValue" yaml:"expectedValue"`
134+
Region string `json:"region" yaml:"region"`
135+
ResourceType string `json:"resourceType" yaml:"resourceType"`
136+
ARNs []string `json:"arns" yaml:"arns"`
137137
}
138138

139139
// AwsValidatorStatus defines the observed state of AwsValidator

0 commit comments

Comments
 (0)