From 39e8148df4bbd0ef7deed90b59922ffdfe8c91ae Mon Sep 17 00:00:00 2001 From: Weston Haught Date: Tue, 8 Sep 2020 09:53:46 -0700 Subject: [PATCH 1/2] Move responsive-gc feature to allowed --- config/core/configmaps/features.yaml | 7 ++----- pkg/apis/config/features.go | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/config/core/configmaps/features.yaml b/config/core/configmaps/features.yaml index 478cc7d0d495..317e1b1d8706 100644 --- a/config/core/configmaps/features.yaml +++ b/config/core/configmaps/features.yaml @@ -20,7 +20,7 @@ metadata: labels: serving.knative.dev/release: devel annotations: - knative.dev/example-checksum: "7f1b7e2d" + knative.dev/example-checksum: "6a69cdef" data: _example: | ################################ @@ -105,10 +105,7 @@ data: # feature labels revisions in real-time as they become referenced and # dereferenced by Routes. This allows us to reap revisions shortly after # they are no longer active. - # - # ALPHA WARNING: This feature is not yet stable or complete. Enabling it - # should be used for testing purposes only. - responsive-revision-gc: "disabled" + responsive-revision-gc: "allowed" # Controls whether tag header based routing feature are enabled or not. # 1. Enabled: enabling tag header based routing diff --git a/pkg/apis/config/features.go b/pkg/apis/config/features.go index 4174ff112790..22f3becc45ab 100644 --- a/pkg/apis/config/features.go +++ b/pkg/apis/config/features.go @@ -48,7 +48,7 @@ func defaultFeaturesConfig() *Features { PodSpecRuntimeClassName: Disabled, PodSpecSecurityContext: Disabled, PodSpecTolerations: Disabled, - ResponsiveRevisionGC: Disabled, + ResponsiveRevisionGC: Allowed, TagHeaderBasedRouting: Disabled, } } From 39ef92d385d624b8f54e5c401f4f39f765bd8a70 Mon Sep 17 00:00:00 2001 From: Weston Haught Date: Tue, 8 Sep 2020 10:35:33 -0700 Subject: [PATCH 2/2] fix unit tests for allowed flag --- .../configuration/resources/revision_test.go | 13 ++++++++----- pkg/reconciler/service/resources/configuration.go | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/pkg/reconciler/configuration/resources/revision_test.go b/pkg/reconciler/configuration/resources/revision_test.go index 6f813ac978a2..c34aeec8966c 100644 --- a/pkg/reconciler/configuration/resources/revision_test.go +++ b/pkg/reconciler/configuration/resources/revision_test.go @@ -323,9 +323,7 @@ func TestMakeRevisions(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { ctx := context.Background() - if test.responsiveGC { - ctx = enableResponsiveGC(ctx) - } + ctx = enableResponsiveGC(ctx, test.responsiveGC) got := MakeRevision(ctx, test.configuration, clock) if diff := cmp.Diff(test.want, got); diff != "" { @@ -335,11 +333,16 @@ func TestMakeRevisions(t *testing.T) { } } -func enableResponsiveGC(ctx context.Context) context.Context { +func enableResponsiveGC(ctx context.Context, enabled bool) context.Context { + flag := cfgmap.Disabled + if enabled { + flag = cfgmap.Enabled + } + defaultDefaults, _ := cfgmap.NewDefaultsConfigFromMap(map[string]string{}) c := &config.Config{ Features: &cfgmap.Features{ - ResponsiveRevisionGC: cfgmap.Enabled, + ResponsiveRevisionGC: flag, }, Defaults: defaultDefaults, } diff --git a/pkg/reconciler/service/resources/configuration.go b/pkg/reconciler/service/resources/configuration.go index e98d6c6b5503..52ecdab89c32 100644 --- a/pkg/reconciler/service/resources/configuration.go +++ b/pkg/reconciler/service/resources/configuration.go @@ -32,7 +32,7 @@ import ( // MakeConfiguration creates a Configuration from a Service object. func MakeConfiguration(service *v1.Service) (*v1.Configuration, error) { - return MakeConfigurationFromExisting(service, &v1.Configuration{}, cfgmap.Disabled) + return MakeConfigurationFromExisting(service, &v1.Configuration{}, cfgmap.Allowed) } // MakeConfigurationFromExisting creates a Configuration from a Service object given an existing Configuration.