Skip to content

Commit 289fcc0

Browse files
Remove support for 6.x stack version (#8507)
* remove support for 6.x version and a deprecation warning for versions 7.0.x to 7.16.x --------- Co-authored-by: Michael Morello <[email protected]>
1 parent 0185fd6 commit 289fcc0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+492
-432
lines changed

.buildkite/e2e/release-branch-matrix.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
fixed:
44
E2E_PROVIDER: gke
55
mixed:
6-
- E2E_STACK_VERSION: "6.8.23"
76
- E2E_STACK_VERSION: "7.17.25"
87
- E2E_STACK_VERSION: "8.0.1"
98
- E2E_STACK_VERSION: "8.1.3"

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ Supported versions:
1919

2020
* Kubernetes 1.28-1.32
2121
* OpenShift 4.13-4.18
22-
* Elasticsearch, Kibana, APM Server: 6.8+, 7.1+, 8+
22+
* Elasticsearch, Kibana, APM Server: 7.17+, 8+
2323
* Enterprise Search: 7.7+, 8+
24-
* Beats: 7.0+, 8+
25-
* Elastic Agent: 7.10+ (standalone), 7.14+, 8+ (Fleet)
26-
* Elastic Maps Server: 7.11+, 8+
24+
* Beats: 7.17+, 8+
25+
* Elastic Agent: 7.17+ (standalone), 7.17+, 8+ (Fleet)
26+
* Elastic Maps Server: 7.17+, 8+
2727
* Logstash 8.12+
2828

2929
Check the [Quickstart](https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-quickstart.html) to deploy your first cluster with ECK.

hack/operatorhub/templates/csv.tpl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -290,15 +290,15 @@ spec:
290290

291291
* Google Kubernetes Engine (GKE), Azure Kubernetes Service (AKS), and Amazon Elastic Kubernetes Service (EKS)
292292

293-
* Elasticsearch, Kibana, APM Server: {{ if .UbiOnly }}7.10+{{ else }}6.8+, 7.1+{{ end }}, 8+
293+
* Elasticsearch, Kibana, APM Server: 7.17+, 8+
294294

295-
* Enterprise Search: {{ if .UbiOnly }}7.10+{{ else }}7.7+{{ end }}, 8+
295+
* Enterprise Search: 7.17+, 8+
296296

297-
* Beats: {{ if .UbiOnly }}7.10+{{ else }}7.0+{{ end }}, 8+
297+
* Beats: 7.17+, 8+
298298

299-
* Elastic Agent: 7.10+, 8+
299+
* Elastic Agent: 7.17+, 8+
300300

301-
* Elastic Maps Server: 7.11+, 8+
301+
* Elastic Maps Server: 7.17+, 8+
302302

303303
* Logstash 8.12+
304304

pkg/apis/agent/v1alpha1/validations.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ func checkSupportedVersion(a *Agent) field.ErrorList {
6161
return commonv1.CheckSupportedStackVersion(a.Spec.Version, version.SupportedAgentVersions)
6262
}
6363

64+
func checkIfVersionDeprecated(a *Agent) (string, field.ErrorList) {
65+
return commonv1.CheckDeprecatedStackVersion(a.Spec.Version)
66+
}
67+
6468
func checkAtMostOneDeploymentOption(a *Agent) field.ErrorList {
6569
var enabledSpecsNames []string
6670

pkg/apis/agent/v1alpha1/validations_test.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,33 @@ func Test_checkAtMostOneDeploymentOption(t *testing.T) {
163163
}
164164
}
165165

166+
func Test_checkIfVersionDeprecated(t *testing.T) {
167+
tests := []struct {
168+
name string
169+
version string
170+
want string
171+
}{
172+
{
173+
name: "not deprecated",
174+
version: "7.17.0",
175+
want: "",
176+
},
177+
{
178+
name: "deprecated",
179+
version: "7.4.0",
180+
want: "Version 7.4.0 is EOL and support for it will be removed in a future release of the ECK operator",
181+
},
182+
}
183+
184+
for _, tt := range tests {
185+
t.Run(tt.name, func(t *testing.T) {
186+
got, err := checkIfVersionDeprecated(&Agent{Spec: AgentSpec{Version: tt.version}})
187+
assert.Nil(t, err)
188+
assert.Equal(t, tt.want, got)
189+
})
190+
}
191+
}
192+
166193
func Test_checkSpec(t *testing.T) {
167194
tests := []struct {
168195
name string

pkg/apis/agent/v1alpha1/webhook.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,16 @@ func (a *Agent) WebhookPath() string {
7777
func (a *Agent) validate(old *Agent) (admission.Warnings, error) {
7878
warnings := a.warnings()
7979
var errors field.ErrorList
80+
81+
// depreciation check
82+
depreciationWarnings, depreciationErrors := checkIfVersionDeprecated(a)
83+
if depreciationErrors != nil {
84+
errors = append(errors, depreciationErrors...)
85+
}
86+
if depreciationWarnings != "" {
87+
warnings = append(warnings, depreciationWarnings)
88+
}
89+
8090
if old != nil {
8191
for _, uc := range updateChecks {
8292
if err := uc(old, a); err != nil {

pkg/apis/apm/v1/webhook.go

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,17 @@ func (as *ApmServer) WebhookPath() string {
8181

8282
func (as *ApmServer) validate(old *ApmServer) (admission.Warnings, error) {
8383
var errors field.ErrorList
84+
var warnings admission.Warnings
85+
86+
// depreciation check
87+
depreciationWarnings, depreciationErrors := checkIfVersionDeprecated(as)
88+
if depreciationErrors != nil {
89+
errors = append(errors, depreciationErrors...)
90+
}
91+
if depreciationWarnings != "" {
92+
warnings = append(warnings, depreciationWarnings)
93+
}
94+
8495
if old != nil {
8596
for _, uc := range updateChecks {
8697
if err := uc(old, as); err != nil {
@@ -89,7 +100,7 @@ func (as *ApmServer) validate(old *ApmServer) (admission.Warnings, error) {
89100
}
90101

91102
if len(errors) > 0 {
92-
return nil, apierrors.NewInvalid(groupKind, as.Name, errors)
103+
return warnings, apierrors.NewInvalid(groupKind, as.Name, errors)
93104
}
94105
}
95106

@@ -100,9 +111,9 @@ func (as *ApmServer) validate(old *ApmServer) (admission.Warnings, error) {
100111
}
101112

102113
if len(errors) > 0 {
103-
return nil, apierrors.NewInvalid(groupKind, as.Name, errors)
114+
return warnings, apierrors.NewInvalid(groupKind, as.Name, errors)
104115
}
105-
return nil, nil
116+
return warnings, nil
106117
}
107118

108119
func checkNoUnknownFields(as *ApmServer) field.ErrorList {
@@ -117,6 +128,10 @@ func checkSupportedVersion(as *ApmServer) field.ErrorList {
117128
return commonv1.CheckSupportedStackVersion(as.Spec.Version, version.SupportedAPMServerVersions)
118129
}
119130

131+
func checkIfVersionDeprecated(as *ApmServer) (string, field.ErrorList) {
132+
return commonv1.CheckDeprecatedStackVersion(as.Spec.Version)
133+
}
134+
120135
func checkNoDowngrade(prev, curr *ApmServer) field.ErrorList {
121136
if commonv1.IsConfiguredToAllowDowngrades(curr) {
122137
return nil

pkg/apis/apm/v1/webhook_test.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,21 +122,23 @@ func TestWebhook(t *testing.T) {
122122
apm.Spec.Version = "7.4.0"
123123
return serialize(t, apm)
124124
},
125-
Check: test.ValidationWebhookSucceeded,
125+
Check: test.ValidationWebhookSucceededWithWarnings(
126+
`Version 7.4.0 is EOL and support for it will be removed in a future release of the ECK operator`,
127+
),
126128
},
127129
{
128130
Name: "update-valid",
129131
Operation: admissionv1beta1.Update,
130132
OldObject: func(t *testing.T, uid string) []byte {
131133
t.Helper()
132134
apm := mkApmServer(uid)
133-
apm.Spec.Version = "7.5.1"
135+
apm.Spec.Version = "8.5.1"
134136
return serialize(t, apm)
135137
},
136138
Object: func(t *testing.T, uid string) []byte {
137139
t.Helper()
138140
apm := mkApmServer(uid)
139-
apm.Spec.Version = "7.6.1"
141+
apm.Spec.Version = "8.6.1"
140142
return serialize(t, apm)
141143
},
142144
Check: test.ValidationWebhookSucceeded,
@@ -147,13 +149,13 @@ func TestWebhook(t *testing.T) {
147149
OldObject: func(t *testing.T, uid string) []byte {
148150
t.Helper()
149151
apm := mkApmServer(uid)
150-
apm.Spec.Version = "7.6.1"
152+
apm.Spec.Version = "8.6.1"
151153
return serialize(t, apm)
152154
},
153155
Object: func(t *testing.T, uid string) []byte {
154156
t.Helper()
155157
apm := mkApmServer(uid)
156-
apm.Spec.Version = "7.5.1"
158+
apm.Spec.Version = "8.5.1"
157159
return serialize(t, apm)
158160
},
159161
Check: test.ValidationWebhookFailed(
@@ -166,13 +168,13 @@ func TestWebhook(t *testing.T) {
166168
OldObject: func(t *testing.T, uid string) []byte {
167169
t.Helper()
168170
apm := mkApmServer(uid)
169-
apm.Spec.Version = "7.6.1"
171+
apm.Spec.Version = "8.6.1"
170172
return serialize(t, apm)
171173
},
172174
Object: func(t *testing.T, uid string) []byte {
173175
t.Helper()
174176
apm := mkApmServer(uid)
175-
apm.Spec.Version = "7.5.1"
177+
apm.Spec.Version = "8.5.1"
176178
apm.Annotations = map[string]string{
177179
commonv1.DisableDowngradeValidationAnnotation: "true",
178180
}
@@ -244,7 +246,7 @@ func mkApmServer(uid string) *apmv1.ApmServer {
244246
UID: types.UID(uid),
245247
},
246248
Spec: apmv1.ApmServerSpec{
247-
Version: "7.6.1",
249+
Version: "7.17.0",
248250
},
249251
}
250252
}

pkg/apis/apm/v1beta1/webhook.go

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,17 @@ func (as *ApmServer) WebhookPath() string {
7575

7676
func (as *ApmServer) validate(old *ApmServer) (admission.Warnings, error) {
7777
var errors field.ErrorList
78+
var warnings admission.Warnings
79+
80+
// depreciation check
81+
depreciationWarnings, depreciationErrors := checkIfVersionDeprecated(as)
82+
if depreciationErrors != nil {
83+
errors = append(errors, depreciationErrors...)
84+
}
85+
if depreciationWarnings != "" {
86+
warnings = append(warnings, depreciationWarnings)
87+
}
88+
7889
if old != nil {
7990
for _, uc := range updateChecks {
8091
if err := uc(old, as); err != nil {
@@ -83,7 +94,7 @@ func (as *ApmServer) validate(old *ApmServer) (admission.Warnings, error) {
8394
}
8495

8596
if len(errors) > 0 {
86-
return nil, apierrors.NewInvalid(groupKind, as.Name, errors)
97+
return warnings, apierrors.NewInvalid(groupKind, as.Name, errors)
8798
}
8899
}
89100

@@ -94,9 +105,9 @@ func (as *ApmServer) validate(old *ApmServer) (admission.Warnings, error) {
94105
}
95106

96107
if len(errors) > 0 {
97-
return nil, apierrors.NewInvalid(groupKind, as.Name, errors)
108+
return warnings, apierrors.NewInvalid(groupKind, as.Name, errors)
98109
}
99-
return nil, nil
110+
return warnings, nil
100111
}
101112

102113
func checkNoUnknownFields(as *ApmServer) field.ErrorList {
@@ -111,6 +122,10 @@ func checkSupportedVersion(as *ApmServer) field.ErrorList {
111122
return commonv1.CheckSupportedStackVersion(as.Spec.Version, version.SupportedAPMServerVersions)
112123
}
113124

125+
func checkIfVersionDeprecated(as *ApmServer) (string, field.ErrorList) {
126+
return commonv1.CheckDeprecatedStackVersion(as.Spec.Version)
127+
}
128+
114129
func checkNoDowngrade(prev, curr *ApmServer) field.ErrorList {
115130
if commonv1.IsConfiguredToAllowDowngrades(curr) {
116131
return nil

pkg/apis/apm/v1beta1/webhook_test.go

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,13 @@ func TestWebhook(t *testing.T) {
105105
OldObject: func(t *testing.T, uid string) []byte {
106106
t.Helper()
107107
apm := mkApmServer(uid)
108-
apm.Spec.Version = "7.5.1"
108+
apm.Spec.Version = "8.5.1"
109109
return serialize(t, apm)
110110
},
111111
Object: func(t *testing.T, uid string) []byte {
112112
t.Helper()
113113
apm := mkApmServer(uid)
114-
apm.Spec.Version = "7.6.1"
114+
apm.Spec.Version = "8.6.1"
115115
return serialize(t, apm)
116116
},
117117
Check: test.ValidationWebhookSucceeded,
@@ -122,32 +122,45 @@ func TestWebhook(t *testing.T) {
122122
OldObject: func(t *testing.T, uid string) []byte {
123123
t.Helper()
124124
apm := mkApmServer(uid)
125-
apm.Spec.Version = "7.6.1"
125+
apm.Spec.Version = "8.6.1"
126126
return serialize(t, apm)
127127
},
128128
Object: func(t *testing.T, uid string) []byte {
129129
t.Helper()
130130
apm := mkApmServer(uid)
131-
apm.Spec.Version = "7.5.1"
131+
apm.Spec.Version = "8.5.1"
132132
return serialize(t, apm)
133133
},
134134
Check: test.ValidationWebhookFailed(
135135
`spec.version: Forbidden: Version downgrades are not supported`,
136136
),
137137
},
138+
{
139+
Name: "deprecated version",
140+
Operation: admissionv1beta1.Create,
141+
Object: func(t *testing.T, uid string) []byte {
142+
t.Helper()
143+
apm := mkApmServer(uid)
144+
apm.Spec.Version = "7.4.0"
145+
return serialize(t, apm)
146+
},
147+
Check: test.ValidationWebhookSucceededWithWarnings(
148+
`Version 7.4.0 is EOL and support for it will be removed in a future release of the ECK operator`,
149+
),
150+
},
138151
{
139152
Name: "version-downgrade with override",
140153
Operation: admissionv1beta1.Update,
141154
OldObject: func(t *testing.T, uid string) []byte {
142155
t.Helper()
143156
apm := mkApmServer(uid)
144-
apm.Spec.Version = "7.6.1"
157+
apm.Spec.Version = "8.6.1"
145158
return serialize(t, apm)
146159
},
147160
Object: func(t *testing.T, uid string) []byte {
148161
t.Helper()
149162
apm := mkApmServer(uid)
150-
apm.Spec.Version = "7.5.1"
163+
apm.Spec.Version = "8.5.1"
151164
apm.Annotations = map[string]string{
152165
commonv1.DisableDowngradeValidationAnnotation: "true",
153166
}
@@ -169,7 +182,7 @@ func mkApmServer(uid string) *apmv1beta1.ApmServer {
169182
UID: types.UID(uid),
170183
},
171184
Spec: apmv1beta1.ApmServerSpec{
172-
Version: "7.6.1",
185+
Version: "7.17.1",
173186
},
174187
}
175188
}

0 commit comments

Comments
 (0)