Skip to content

Commit 721523e

Browse files
committed
Updated feature gates doc and key name
1 parent 545affd commit 721523e

File tree

6 files changed

+16
-15
lines changed

6 files changed

+16
-15
lines changed

docs/deploy/configurations.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,9 @@ If running on EC2, the default values are obtained from the instance metadata se
133133
134134
135135
### Feature Gates
136-
This is a controller to enable and disable features. You can use it as flags `--feature-gates=key1=value1,key2=value2`
137-
|Features-gate Supported Key | Type | Default Value | Description |
136+
They are a set of kye=value pairs that describe AWS load balance controller features. You can use it as flags `--feature-gates=key1=value1,key2=value2`
137+
138+
|Features-gate Supported Key | Type | Default Value | Description |
138139
|---------------------------------------|---------------------------------|-----------------|-------------|
139-
|EnableListenerRulesTagging | string | true | Enable or disable tagging AWS load balancer listeners and rules |
140-
|EnableWeightedTargetGroups | string | true | Enable or disable weighted target groups |
140+
|ListenerRulesTagging | string | true | Enable or disable tagging AWS load balancer listeners and rules |
141+
|WeightedTargetGroups | string | true | Enable or disable weighted target groups |

pkg/config/feature_gates.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import (
1010
type Feature string
1111

1212
const (
13-
EnableListenerRulesTagging Feature = "EnableListenerRulesTagging"
14-
EnableWeightedTargetGroups Feature = "EnableWeightedTargetGroups"
13+
ListenerRulesTagging Feature = "ListenerRulesTagging"
14+
WeightedTargetGroups Feature = "WeightedTargetGroups"
1515
)
1616

1717
type FeatureGates interface {
@@ -39,8 +39,8 @@ type defaultFeatureGates struct {
3939
func NewFeatureGates() FeatureGates {
4040
return &defaultFeatureGates{
4141
featureState: map[Feature]bool{
42-
EnableListenerRulesTagging: true,
43-
EnableWeightedTargetGroups: true,
42+
ListenerRulesTagging: true,
43+
WeightedTargetGroups: true,
4444
},
4545
}
4646
}

pkg/deploy/elbv2/listener_manager.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func (m *defaultListenerManager) Create(ctx context.Context, resLS *elbv2model.L
6262
return elbv2model.ListenerStatus{}, err
6363
}
6464
var lsTags map[string]string
65-
if m.featureGates.Enabled(config.EnableListenerRulesTagging) {
65+
if m.featureGates.Enabled(config.ListenerRulesTagging) {
6666
lsTags = m.trackingProvider.ResourceTags(resLS.Stack(), resLS, resLS.Spec.Tags)
6767
}
6868
req.Tags = convertTagsToSDKTags(lsTags)
@@ -92,7 +92,7 @@ func (m *defaultListenerManager) Create(ctx context.Context, resLS *elbv2model.L
9292
}
9393

9494
func (m *defaultListenerManager) Update(ctx context.Context, resLS *elbv2model.Listener, sdkLS ListenerWithTags) (elbv2model.ListenerStatus, error) {
95-
if m.featureGates.Enabled(config.EnableListenerRulesTagging) {
95+
if m.featureGates.Enabled(config.ListenerRulesTagging) {
9696
if err := m.updateSDKListenerWithTags(ctx, resLS, sdkLS); err != nil {
9797
return elbv2model.ListenerStatus{}, err
9898
}

pkg/deploy/elbv2/listener_rule_manager.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func (m *defaultListenerRuleManager) Create(ctx context.Context, resLR *elbv2mod
5959
return elbv2model.ListenerRuleStatus{}, err
6060
}
6161
var ruleTags map[string]string
62-
if m.featureGates.Enabled(config.EnableListenerRulesTagging) {
62+
if m.featureGates.Enabled(config.ListenerRulesTagging) {
6363
ruleTags = m.trackingProvider.ResourceTags(resLR.Stack(), resLR, resLR.Spec.Tags)
6464
}
6565
req.Tags = convertTagsToSDKTags(ruleTags)
@@ -90,7 +90,7 @@ func (m *defaultListenerRuleManager) Create(ctx context.Context, resLR *elbv2mod
9090
}
9191

9292
func (m *defaultListenerRuleManager) Update(ctx context.Context, resLR *elbv2model.ListenerRule, sdkLR ListenerRuleWithTags) (elbv2model.ListenerRuleStatus, error) {
93-
if m.featureGates.Enabled(config.EnableListenerRulesTagging) {
93+
if m.featureGates.Enabled(config.ListenerRulesTagging) {
9494
if err := m.updateSDKListenerRuleWithTags(ctx, resLR, sdkLR); err != nil {
9595
return elbv2model.ListenerRuleStatus{}, err
9696
}

pkg/deploy/elbv2/listener_utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func buildSDKAction(modelAction elbv2model.Action, featureGates config.FeatureGa
5252
if err != nil {
5353
return nil, err
5454
}
55-
if !featureGates.Enabled(config.EnableWeightedTargetGroups) {
55+
if !featureGates.Enabled(config.WeightedTargetGroups) {
5656
if len(forwardConfig.TargetGroups) == 1 {
5757
sdkObj.TargetGroupArn = forwardConfig.TargetGroups[0].TargetGroupArn
5858
} else {

pkg/deploy/elbv2/tagging_manager.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ func (m *defaultTaggingManager) ListListeners(ctx context.Context, lbARN string)
187187
lsByARN[lsARN] = listener
188188
}
189189
var tagsByARN map[string]map[string]string
190-
if m.featureGates.Enabled(config.EnableListenerRulesTagging) {
190+
if m.featureGates.Enabled(config.ListenerRulesTagging) {
191191
tagsByARN, err = m.describeResourceTags(ctx, lsARNs)
192192
if err != nil {
193193
return nil, err
@@ -220,7 +220,7 @@ func (m *defaultTaggingManager) ListListenerRules(ctx context.Context, lsARN str
220220
lrByARN[lrARN] = rule
221221
}
222222
var tagsByARN map[string]map[string]string
223-
if m.featureGates.Enabled(config.EnableListenerRulesTagging) {
223+
if m.featureGates.Enabled(config.ListenerRulesTagging) {
224224
tagsByARN, err = m.describeResourceTags(ctx, lrARNs)
225225
if err != nil {
226226
return nil, err

0 commit comments

Comments
 (0)