Skip to content

Add new featuregate to enable/disable SG management #2919

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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
34 changes: 18 additions & 16 deletions pkg/config/feature_gates.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ import (
type Feature string

const (
ListenerRulesTagging Feature = "ListenerRulesTagging"
WeightedTargetGroups Feature = "WeightedTargetGroups"
ServiceTypeLoadBalancerOnly Feature = "ServiceTypeLoadBalancerOnly"
EndpointsFailOpen Feature = "EndpointsFailOpen"
EnableServiceController Feature = "EnableServiceController"
EnableIPTargetType Feature = "EnableIPTargetType"
SubnetsClusterTagCheck Feature = "SubnetsClusterTagCheck"
NLBHealthCheckAdvancedConfig Feature = "NLBHealthCheckAdvancedConfig"
ListenerRulesTagging Feature = "ListenerRulesTagging"
WeightedTargetGroups Feature = "WeightedTargetGroups"
ServiceTypeLoadBalancerOnly Feature = "ServiceTypeLoadBalancerOnly"
EndpointsFailOpen Feature = "EndpointsFailOpen"
EnableServiceController Feature = "EnableServiceController"
EnableIPTargetType Feature = "EnableIPTargetType"
SubnetsClusterTagCheck Feature = "SubnetsClusterTagCheck"
NLBHealthCheckTimeout Feature = "NLBHealthCheckTimeout"
ManageSecurityGroups Feature = "ManageSecurityGroups"
)

type FeatureGates interface {
Expand Down Expand Up @@ -46,14 +47,15 @@ type defaultFeatureGates struct {
func NewFeatureGates() FeatureGates {
return &defaultFeatureGates{
featureState: map[Feature]bool{
ListenerRulesTagging: true,
WeightedTargetGroups: true,
ServiceTypeLoadBalancerOnly: false,
EndpointsFailOpen: false,
EnableServiceController: true,
EnableIPTargetType: true,
SubnetsClusterTagCheck: true,
NLBHealthCheckAdvancedConfig: true,
ListenerRulesTagging: true,
WeightedTargetGroups: true,
ServiceTypeLoadBalancerOnly: false,
EndpointsFailOpen: false,
EnableServiceController: true,
EnableIPTargetType: true,
SubnetsClusterTagCheck: true,
NLBHealthCheckTimeout: true,
ManageSecurityGroups: true,
},
}
}
Expand Down
3 changes: 3 additions & 0 deletions pkg/service/model_build_target_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,9 @@ func (t *defaultModelBuildTask) buildHealthCheckNetworkingIngressRules(trafficSo

func (t *defaultModelBuildTask) buildManageSecurityGroupRulesFlag(_ context.Context) (bool, error) {
var rawEnabled bool
if !t.featureGates.Enabled(config.ManageSecurityGroups) {
return false, nil
}
exists, err := t.annotationParser.ParseBoolAnnotation(annotations.SvcLBSuffixManageSGRules, &rawEnabled, t.service.Annotations)
if err != nil {
return true, err
Expand Down