Skip to content

Commit d6d9f2f

Browse files
authored
Bump kubernetes to 1.27 operator and target allocator (open-telemetry#1653)
* Bump kubernetes to 1.27 everywhere * fix broken updates * Fix dep order * rename * upgrade controller-gen and kustomize * bump allocator deps * unbump opamp bridge for now * upgrade deprecations * fix kuttl test * bundle
1 parent e68ee34 commit d6d9f2f

27 files changed

+531
-519
lines changed

.github/workflows/e2e.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
# should be compatible with them.
2323
kube-version:
2424
- "1.19"
25-
- "1.26"
25+
- "1.27"
2626
group:
2727
- e2e e2e-upgrade
2828
- e2e-autoscale

.github/workflows/scorecard.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
matrix:
1919
kube-version:
2020
- "1.19"
21-
- "1.26"
21+
- "1.27"
2222

2323
steps:
2424

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,8 @@ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
290290
ENVTEST ?= $(LOCALBIN)/setup-envtest
291291
CHLOGGEN ?= $(LOCALBIN)/chloggen
292292

293-
KUSTOMIZE_VERSION ?= v5.0.0
294-
CONTROLLER_TOOLS_VERSION ?= v0.11.3
293+
KUSTOMIZE_VERSION ?= v5.0.3
294+
CONTROLLER_TOOLS_VERSION ?= v0.12.0
295295

296296

297297
.PHONY: kustomize

apis/v1alpha1/instrumentation_webhook.go

+7-6
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
ctrl "sigs.k8s.io/controller-runtime"
2626
logf "sigs.k8s.io/controller-runtime/pkg/log"
2727
"sigs.k8s.io/controller-runtime/pkg/webhook"
28+
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
2829
)
2930

3031
const (
@@ -177,21 +178,21 @@ func (r *Instrumentation) Default() {
177178
var _ webhook.Validator = &Instrumentation{}
178179

179180
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type.
180-
func (r *Instrumentation) ValidateCreate() error {
181+
func (r *Instrumentation) ValidateCreate() (admission.Warnings, error) {
181182
instrumentationlog.Info("validate create", "name", r.Name)
182-
return r.validate()
183+
return nil, r.validate()
183184
}
184185

185186
// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.
186-
func (r *Instrumentation) ValidateUpdate(old runtime.Object) error {
187+
func (r *Instrumentation) ValidateUpdate(old runtime.Object) (admission.Warnings, error) {
187188
instrumentationlog.Info("validate update", "name", r.Name)
188-
return r.validate()
189+
return nil, r.validate()
189190
}
190191

191192
// ValidateDelete implements webhook.Validator so a webhook will be registered for the type.
192-
func (r *Instrumentation) ValidateDelete() error {
193+
func (r *Instrumentation) ValidateDelete() (admission.Warnings, error) {
193194
instrumentationlog.Info("validate delete", "name", r.Name)
194-
return nil
195+
return nil, nil
195196
}
196197

197198
func (r *Instrumentation) validate() error {

apis/v1alpha1/instrumentation_webhook_test.go

+10-4
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,18 @@ func TestInstrumentationValidatingWebhook(t *testing.T) {
9696
for _, test := range tests {
9797
t.Run(test.name, func(t *testing.T) {
9898
if test.err == "" {
99-
assert.Nil(t, test.inst.ValidateCreate())
100-
assert.Nil(t, test.inst.ValidateUpdate(nil))
99+
warnings, err := test.inst.ValidateCreate()
100+
assert.Nil(t, warnings)
101+
assert.Nil(t, err)
102+
warnings, err = test.inst.ValidateUpdate(nil)
103+
assert.Nil(t, warnings)
104+
assert.Nil(t, err)
101105
} else {
102-
err := test.inst.ValidateCreate()
106+
warnings, err := test.inst.ValidateCreate()
107+
assert.Nil(t, warnings)
103108
assert.Contains(t, err.Error(), test.err)
104-
err = test.inst.ValidateUpdate(nil)
109+
warnings, err = test.inst.ValidateUpdate(nil)
110+
assert.Nil(t, warnings)
105111
assert.Contains(t, err.Error(), test.err)
106112
}
107113
})

apis/v1alpha1/opentelemetrycollector_webhook.go

+7-6
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
ctrl "sigs.k8s.io/controller-runtime"
2626
logf "sigs.k8s.io/controller-runtime/pkg/log"
2727
"sigs.k8s.io/controller-runtime/pkg/webhook"
28+
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
2829

2930
"github.com/open-telemetry/opentelemetry-operator/pkg/featuregate"
3031
ta "github.com/open-telemetry/opentelemetry-operator/pkg/targetallocator/adapters"
@@ -116,21 +117,21 @@ func (r *OpenTelemetryCollector) Default() {
116117
var _ webhook.Validator = &OpenTelemetryCollector{}
117118

118119
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type.
119-
func (r *OpenTelemetryCollector) ValidateCreate() error {
120+
func (r *OpenTelemetryCollector) ValidateCreate() (admission.Warnings, error) {
120121
opentelemetrycollectorlog.Info("validate create", "name", r.Name)
121-
return r.validateCRDSpec()
122+
return nil, r.validateCRDSpec()
122123
}
123124

124125
// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.
125-
func (r *OpenTelemetryCollector) ValidateUpdate(old runtime.Object) error {
126+
func (r *OpenTelemetryCollector) ValidateUpdate(old runtime.Object) (admission.Warnings, error) {
126127
opentelemetrycollectorlog.Info("validate update", "name", r.Name)
127-
return r.validateCRDSpec()
128+
return nil, r.validateCRDSpec()
128129
}
129130

130131
// ValidateDelete implements webhook.Validator so a webhook will be registered for the type.
131-
func (r *OpenTelemetryCollector) ValidateDelete() error {
132+
func (r *OpenTelemetryCollector) ValidateDelete() (admission.Warnings, error) {
132133
opentelemetrycollectorlog.Info("validate delete", "name", r.Name)
133-
return nil
134+
return nil, nil
134135
}
135136

136137
func (r *OpenTelemetryCollector) validateCRDSpec() error {

bundle/manifests/opentelemetry-operator.clusterserviceversion.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ metadata:
3131
categories: Logging & Tracing
3232
certified: "false"
3333
containerImage: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator
34-
createdAt: "2023-05-24T11:54:55Z"
34+
createdAt: "2023-05-31T15:42:55Z"
3535
description: Provides the OpenTelemetry components, including the Collector
3636
operators.operatorframework.io/builder: operator-sdk-v1.27.0
3737
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3

bundle/manifests/opentelemetry.io_instrumentations.yaml

+13-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
22
kind: CustomResourceDefinition
33
metadata:
44
annotations:
5-
controller-gen.kubebuilder.io/version: v0.11.3
5+
controller-gen.kubebuilder.io/version: v0.12.0
66
creationTimestamp: null
77
labels:
88
app.kubernetes.io/name: opentelemetry-operator
@@ -343,7 +343,8 @@ spec:
343343
description: 'Requests describes the minimum amount of compute
344344
resources required. If Requests is omitted for a container,
345345
it defaults to Limits if that is explicitly specified, otherwise
346-
to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
346+
to an implementation-defined value. Requests cannot exceed
347+
Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
347348
type: object
348349
type: object
349350
version:
@@ -520,7 +521,8 @@ spec:
520521
description: 'Requests describes the minimum amount of compute
521522
resources required. If Requests is omitted for a container,
522523
it defaults to Limits if that is explicitly specified, otherwise
523-
to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
524+
to an implementation-defined value. Requests cannot exceed
525+
Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
524526
type: object
525527
type: object
526528
type: object
@@ -818,7 +820,8 @@ spec:
818820
description: 'Requests describes the minimum amount of compute
819821
resources required. If Requests is omitted for a container,
820822
it defaults to Limits if that is explicitly specified, otherwise
821-
to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
823+
to an implementation-defined value. Requests cannot exceed
824+
Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
822825
type: object
823826
type: object
824827
type: object
@@ -992,7 +995,8 @@ spec:
992995
description: 'Requests describes the minimum amount of compute
993996
resources required. If Requests is omitted for a container,
994997
it defaults to Limits if that is explicitly specified, otherwise
995-
to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
998+
to an implementation-defined value. Requests cannot exceed
999+
Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
9961000
type: object
9971001
type: object
9981002
type: object
@@ -1165,7 +1169,8 @@ spec:
11651169
description: 'Requests describes the minimum amount of compute
11661170
resources required. If Requests is omitted for a container,
11671171
it defaults to Limits if that is explicitly specified, otherwise
1168-
to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
1172+
to an implementation-defined value. Requests cannot exceed
1173+
Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
11691174
type: object
11701175
type: object
11711176
type: object
@@ -1355,7 +1360,8 @@ spec:
13551360
description: 'Requests describes the minimum amount of compute
13561361
resources required. If Requests is omitted for a container,
13571362
it defaults to Limits if that is explicitly specified, otherwise
1358-
to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
1363+
to an implementation-defined value. Requests cannot exceed
1364+
Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
13591365
type: object
13601366
type: object
13611367
type: object

0 commit comments

Comments
 (0)