Skip to content
Merged
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
7 changes: 2 additions & 5 deletions config/core/configmaps/features.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ metadata:
labels:
serving.knative.dev/release: devel
annotations:
knative.dev/example-checksum: "7f1b7e2d"
knative.dev/example-checksum: "6a69cdef"
data:
_example: |
################################
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/config/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func defaultFeaturesConfig() *Features {
PodSpecRuntimeClassName: Disabled,
PodSpecSecurityContext: Disabled,
PodSpecTolerations: Disabled,
ResponsiveRevisionGC: Disabled,
ResponsiveRevisionGC: Allowed,
TagHeaderBasedRouting: Disabled,
}
}
Expand Down
13 changes: 8 additions & 5 deletions pkg/reconciler/configuration/resources/revision_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 != "" {
Expand All @@ -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,
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciler/service/resources/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down