@@ -17,7 +17,7 @@ const (
17
17
flagLogLevel = "log-level"
18
18
flagK8sClusterName = "cluster-name"
19
19
flagDefaultTags = "default-tags"
20
- flagResourcePrefix = "resource-prefix "
20
+ flagResourceTrackingConfiguration = "resource-tracking-configuration "
21
21
flagDefaultTargetType = "default-target-type"
22
22
flagExternalManagedTags = "external-managed-tags"
23
23
flagServiceTargetENISGTags = "service-target-eni-security-group-tags"
@@ -89,8 +89,8 @@ type ControllerConfig struct {
89
89
// Default AWS Tags that will be applied to all AWS resources managed by this controller.
90
90
DefaultTags map [string ]string
91
91
92
- // ResourcePrefix provides prefix for resource tags, backend SG name and worker node SG rules label.
93
- ResourcePrefix map [string ]string
92
+ // ResourceTrackingConfiguration provides tracking prefix for resource tags, backend SG name and worker node SG rules label.
93
+ ResourceTrackingConfiguration map [string ]string
94
94
95
95
// Default target type for Ingress and Service objects
96
96
DefaultTargetType string
@@ -157,7 +157,7 @@ func (cfg *ControllerConfig) BindFlags(fs *pflag.FlagSet) {
157
157
"Disable the usage of restricted security group rules" )
158
158
fs .StringToStringVar (& cfg .ServiceTargetENISGTags , flagServiceTargetENISGTags , nil ,
159
159
"AWS Tags, in addition to cluster tags, for finding the target ENI security group to which to add inbound rules from NLBs" )
160
- fs .StringToStringVar (& cfg .ResourcePrefix , flagResourcePrefix , defaultResourcePrefix ,
160
+ fs .StringToStringVar (& cfg .ResourceTrackingConfiguration , flagResourceTrackingConfiguration , defaultResourcePrefix ,
161
161
"the prefixes for resource tags, backend SG name and worker node SG rules label." )
162
162
163
163
cfg .FeatureGates .BindFlags (fs )
@@ -180,12 +180,12 @@ func (cfg *ControllerConfig) Validate() error {
180
180
}
181
181
182
182
trackingTagKeys := sets .New [string ](
183
- cfg .ResourcePrefix [ClusterTagPrefixKey ]+ "/cluster" ,
184
- cfg .ResourcePrefix [ClusterTagPrefixKey ]+ "/resource" ,
185
- cfg .ResourcePrefix [IngressTagPrefixKey ]+ "/stack" ,
186
- cfg .ResourcePrefix [IngressTagPrefixKey ]+ "/resource" ,
187
- cfg .ResourcePrefix [ServiceTagPrefixKey ]+ "/stack" ,
188
- cfg .ResourcePrefix [ServiceTagPrefixKey ]+ "/resource" ,
183
+ cfg .ResourceTrackingConfiguration [ClusterTagPrefixKey ]+ "/cluster" ,
184
+ cfg .ResourceTrackingConfiguration [ClusterTagPrefixKey ]+ "/resource" ,
185
+ cfg .ResourceTrackingConfiguration [IngressTagPrefixKey ]+ "/stack" ,
186
+ cfg .ResourceTrackingConfiguration [IngressTagPrefixKey ]+ "/resource" ,
187
+ cfg .ResourceTrackingConfiguration [ServiceTagPrefixKey ]+ "/stack" ,
188
+ cfg .ResourceTrackingConfiguration [ServiceTagPrefixKey ]+ "/resource" ,
189
189
)
190
190
191
191
if err := cfg .validateDefaultTagsCollisionWithTrackingTags (trackingTagKeys ); err != nil {
@@ -254,8 +254,8 @@ func (cfg *ControllerConfig) validateBackendSecurityGroupConfiguration() error {
254
254
}
255
255
256
256
func (cfg * ControllerConfig ) validateResourcePrefixKeys () error {
257
- keys := make ([]string , 0 , len (cfg .ResourcePrefix ))
258
- for key := range cfg .ResourcePrefix {
257
+ keys := make ([]string , 0 , len (cfg .ResourceTrackingConfiguration ))
258
+ for key := range cfg .ResourceTrackingConfiguration {
259
259
if ! validPrefixKeys .Has (key ) {
260
260
return fmt .Errorf ("invalid key: %s. Valid keys are: %v" , key , validPrefixKeys .List ())
261
261
}
0 commit comments