File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4747 ConfigMapSupportEnabled bool
4848 SecretSupportEnabled bool
4949 PCSSupportEnabled bool
50+ ForwardSupportEnabled bool
5051 }
5152)
5253
@@ -70,6 +71,7 @@ func main() {
7071 kingpin .Flag ("enable-configmap-support" , "Enable support for ConfigMaps on StackSets." ).Default ("false" ).BoolVar (& config .ConfigMapSupportEnabled )
7172 kingpin .Flag ("enable-secret-support" , "Enable support for Secrets on StackSets." ).Default ("false" ).BoolVar (& config .SecretSupportEnabled )
7273 kingpin .Flag ("enable-pcs-support" , "Enable support for PlatformCredentialsSet on StackSets." ).Default ("false" ).BoolVar (& config .PCSSupportEnabled )
74+ kingpin .Flag ("enable-forward-support" , "Enable support for skipper traffic forwarding." ).Default ("false" ).BoolVar (& config .ForwardSupportEnabled )
7375 kingpin .Parse ()
7476
7577 if config .Debug {
@@ -91,6 +93,7 @@ func main() {
9193 ConfigMapSupportEnabled : config .ConfigMapSupportEnabled ,
9294 SecretSupportEnabled : config .SecretSupportEnabled ,
9395 PcsSupportEnabled : config .PCSSupportEnabled ,
96+ ForwardSupportEnabled : config .ForwardSupportEnabled ,
9497 }
9598
9699 ctx , cancel := context .WithCancel (context .Background ())
Original file line number Diff line number Diff line change @@ -77,6 +77,7 @@ type StackSetConfig struct {
7777 ConfigMapSupportEnabled bool
7878 SecretSupportEnabled bool
7979 PcsSupportEnabled bool
80+ ForwardSupportEnabled bool
8081}
8182
8283type stacksetEvent struct {
@@ -758,7 +759,7 @@ func (c *StackSetController) ReconcileTrafficSegments(
758759
759760// CreateCurrentStack creates a new Stack object for the current stack, if needed
760761func (c * StackSetController ) CreateCurrentStack (ctx context.Context , ssc * core.StackSetContainer ) error {
761- newStack , newStackVersion := ssc .NewStack ()
762+ newStack , newStackVersion := ssc .NewStack (c . config . ForwardSupportEnabled )
762763 if newStack == nil {
763764 return nil
764765 }
Original file line number Diff line number Diff line change @@ -53,8 +53,11 @@ func sanitizeServicePorts(service *zv1.StackServiceSpec) *zv1.StackServiceSpec {
5353}
5454
5555// NewStack returns an (optional) stack that should be created
56- func (ssc * StackSetContainer ) NewStack () (* StackContainer , string ) {
56+ func (ssc * StackSetContainer ) NewStack (forwardSupportEnabled bool ) (* StackContainer , string ) {
5757 _ , forwardMigration := ssc .StackSet .ObjectMeta .Annotations [forwardBackendAnnotation ]
58+ if ! forwardSupportEnabled {
59+ forwardMigration = false
60+ }
5861 observedStackVersion := ssc .StackSet .Status .ObservedStackVersion
5962 stackVersion := currentStackVersion (ssc .StackSet )
6063 stackName := generateStackName (ssc .StackSet , stackVersion )
Original file line number Diff line number Diff line change @@ -371,7 +371,7 @@ func TestStackSetNewStack(t *testing.T) {
371371 StackContainers : tc .stacks ,
372372 backendWeightsAnnotationKey : traffic .DefaultBackendWeightsAnnotationKey ,
373373 }
374- newStack , newStackName := stackset .NewStack ()
374+ newStack , newStackName := stackset .NewStack (false )
375375 require .EqualValues (t , tc .expectedStack , newStack )
376376 require .EqualValues (t , tc .expectedStackName , newStackName )
377377 })
You can’t perform that action at this time.
0 commit comments