Skip to content

Commit d6477e5

Browse files
authored
Remove obsoleted feature flags (#6108)
1 parent 0c14b94 commit d6477e5

File tree

6 files changed

+0
-168
lines changed

6 files changed

+0
-168
lines changed

pkg/api/exp/flag.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package exp
22

33
import (
44
"strconv"
5-
"time"
65
)
76

87
const (
@@ -11,9 +10,6 @@ const (
1110
PublicRegistryKey = FFPrefix + "public-registry"
1211
NoProxyKey = FFPrefix + "no-proxy"
1312

14-
// Deprecated: Dedicated field since v1beta2.
15-
APIRequestThresholdKey = FFPrefix + "dynatrace-api-request-threshold"
16-
1713
UseEECLegacyMountsKey = FFPrefix + "use-eec-legacy-mounts"
1814

1915
silentPhrase = "silent"
@@ -30,16 +26,6 @@ func NewFlags(annotations map[string]string) *FeatureFlags {
3026
return &FeatureFlags{annotations: annotations}
3127
}
3228

33-
// Deprecated: Dedicated field since v1beta2.
34-
func (ff *FeatureFlags) GetAPIRequestThreshold() time.Duration {
35-
interval := ff.getIntWithDefault(APIRequestThresholdKey, DefaultMinRequestThresholdMinutes)
36-
if interval < 0 {
37-
interval = DefaultMinRequestThresholdMinutes
38-
}
39-
40-
return time.Duration(interval) * time.Minute
41-
}
42-
4329
// GetNoProxy is a feature flag to set the NO_PROXY value to be used by the dtClient.
4430
func (ff *FeatureFlags) GetNoProxy() string {
4531
return ff.getRaw(NoProxyKey)

pkg/api/exp/flag_test.go

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package exp
22

33
import (
44
"testing"
5-
"time"
65

76
"github.com/stretchr/testify/assert"
87
)
@@ -40,59 +39,6 @@ func TestGetNoProxy(t *testing.T) {
4039
}
4140
}
4241

43-
func TestGetApiRequestThreshold(t *testing.T) {
44-
type testCase struct {
45-
title string
46-
in string
47-
out time.Duration
48-
}
49-
50-
cases := []testCase{
51-
{
52-
title: "default",
53-
in: "",
54-
out: DefaultMinRequestThresholdMinutes * time.Minute,
55-
},
56-
{
57-
title: "with incorrect value type, negative int",
58-
in: "-1",
59-
out: DefaultMinRequestThresholdMinutes * time.Minute,
60-
},
61-
{
62-
title: "with incorrect value type, too big int",
63-
in: "99999999999999999999999999999999999999999999999999999999999999999999999",
64-
out: DefaultMinRequestThresholdMinutes * time.Minute,
65-
},
66-
{
67-
title: "with incorrect value type, string",
68-
in: "not a number",
69-
out: DefaultMinRequestThresholdMinutes * time.Minute,
70-
},
71-
{
72-
title: "with incorrect value type, go time format",
73-
in: "1h",
74-
out: DefaultMinRequestThresholdMinutes * time.Minute,
75-
},
76-
{
77-
title: "overrule",
78-
in: "5",
79-
out: 5 * time.Minute,
80-
},
81-
}
82-
83-
for _, c := range cases {
84-
t.Run(c.title, func(t *testing.T) {
85-
ff := FeatureFlags{annotations: map[string]string{
86-
APIRequestThresholdKey: c.in,
87-
}}
88-
89-
out := ff.GetAPIRequestThreshold()
90-
91-
assert.Equal(t, c.out, out)
92-
})
93-
}
94-
}
95-
9642
func TestGetIntWithDefault(t *testing.T) {
9743
type testCase struct {
9844
title string

pkg/api/exp/injection.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@ import (
66
)
77

88
const (
9-
// Deprecated: Dedicated field since v1beta3.
10-
InjectionDisableMetadataEnrichmentKey = FFPrefix + "disable-metadata-enrichment"
11-
// Deprecated: Dedicated field since v1beta3.
12-
InjectionMetadataEnrichmentKey = FFPrefix + "metadata-enrichment"
13-
149
InjectionIgnoredNamespacesKey = FFPrefix + "ignored-namespaces"
1510
InjectionAutomaticKey = FFPrefix + "automatic-injection"
1611
InjectionLabelVersionDetectionKey = FFPrefix + "label-version-detection"
@@ -20,11 +15,6 @@ const (
2015
InjectionSeccompKey = FFPrefix + "init-container-seccomp-profile"
2116
)
2217

23-
// Deprecated: Dedicated field since v1beta3.
24-
func (ff *FeatureFlags) DisableMetadataEnrichment() bool {
25-
return ff.getDisableFlagWithDeprecatedAnnotation(InjectionMetadataEnrichmentKey, InjectionDisableMetadataEnrichmentKey)
26-
}
27-
2818
// IsAutomaticInjection controls OneAgent is injected to pods in selected namespaces automatically ("automatic-injection=true" or flag not set)
2919
// or if pods need to be opted-in one by one ("automatic-injection=false").
3020
func (ff *FeatureFlags) IsAutomaticInjection() bool {

pkg/api/exp/injection_test.go

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -6,55 +6,6 @@ import (
66
"github.com/stretchr/testify/assert"
77
)
88

9-
func TestDisableMetadataEnrichment(t *testing.T) {
10-
type testCase struct {
11-
title string
12-
in string
13-
depIn string
14-
out bool
15-
}
16-
17-
cases := []testCase{
18-
{
19-
title: "default",
20-
in: "",
21-
depIn: "",
22-
out: false,
23-
},
24-
{
25-
title: "overrule, non deprecated key",
26-
in: "false",
27-
depIn: "",
28-
out: true,
29-
},
30-
{
31-
title: "overrule, deprecated key",
32-
in: "",
33-
depIn: "true",
34-
out: true,
35-
},
36-
{
37-
title: "overrule, no deprecated key overrules",
38-
in: "true",
39-
depIn: "true",
40-
out: false,
41-
},
42-
}
43-
44-
for _, c := range cases {
45-
t.Run(c.title, func(t *testing.T) {
46-
ff := FeatureFlags{annotations: map[string]string{
47-
InjectionMetadataEnrichmentKey: c.in,
48-
InjectionDisableMetadataEnrichmentKey: c.depIn,
49-
}}
50-
51-
out := ff.DisableMetadataEnrichment()
52-
53-
assert.Equal(t, c.out, out)
54-
})
55-
}
56-
}
57-
589
func TestGetIgnoredNamespaces(t *testing.T) {
5910
type testCase struct {
6011
title string

pkg/api/exp/oneagent.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ const (
99
OAPrivilegedKey = FFPrefix + "oneagent-privileged"
1010
OASkipLivenessProbeKey = FFPrefix + "oneagent-skip-liveness-probe"
1111

12-
// Deprecated: Dedicated field since v1beta2.
13-
OASecCompProfileKey = FFPrefix + "oneagent-seccomp-profile"
14-
1512
OANodeImagePullKey = FFPrefix + "node-image-pull"
1613
// OANodeImagePullTechnologiesKey can be set on a Pod or DynaKube to configure which code module technologies to download. It's set to
1714
// "all" if not set.
@@ -22,11 +19,6 @@ const (
2219
DefaultOAIstioInitialConnectRetry = 6000
2320
)
2421

25-
// Deprecated: Dedicated field since v1beta2.
26-
func (ff *FeatureFlags) GetOneAgentSecCompProfile() string {
27-
return ff.getRaw(OASecCompProfileKey)
28-
}
29-
3022
// GetOneAgentMaxUnavailable is a feature flag to configure maxUnavailable on the OneAgent DaemonSets rolling upgrades.
3123
func (ff *FeatureFlags) GetOneAgentMaxUnavailable() int {
3224
return ff.getIntWithDefault(OAMaxUnavailableKey, 1)

pkg/api/exp/oneagent_test.go

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -120,39 +120,6 @@ func TestGetOneAgentMaxUnavailable(t *testing.T) {
120120
}
121121
}
122122

123-
func TestGetOneAgentSecCompProfile(t *testing.T) {
124-
type testCase struct {
125-
title string
126-
in string
127-
out string
128-
}
129-
130-
cases := []testCase{
131-
{
132-
title: "default",
133-
in: "",
134-
out: "",
135-
},
136-
{
137-
title: "overrule",
138-
in: "my-seccomp",
139-
out: "my-seccomp",
140-
},
141-
}
142-
143-
for _, c := range cases {
144-
t.Run(c.title, func(t *testing.T) {
145-
ff := FeatureFlags{annotations: map[string]string{
146-
OASecCompProfileKey: c.in,
147-
}}
148-
149-
out := ff.GetOneAgentSecCompProfile()
150-
151-
assert.Equal(t, c.out, out)
152-
})
153-
}
154-
}
155-
156123
func TestOneAgentIgnoresProxyProxy(t *testing.T) {
157124
type testCase struct {
158125
title string

0 commit comments

Comments
 (0)