Skip to content

Commit 4d86479

Browse files
committed
Fix build errors
1 parent 7f86f05 commit 4d86479

File tree

3,004 files changed

+69782
-121854
lines changed

Some content is hidden

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

3,004 files changed

+69782
-121854
lines changed

go.mod

+4-5
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ require (
3131
go.etcd.io/etcd/client/v3 v3.5.16
3232
k8s.io/api v0.32.3
3333
k8s.io/apiextensions-apiserver v0.32.1
34-
k8s.io/apimachinery v0.32.3
34+
k8s.io/apimachinery v0.32.1
3535
k8s.io/apiserver v0.32.1
3636
k8s.io/client-go v1.5.2
3737
k8s.io/cloud-provider v0.32.1
@@ -47,6 +47,7 @@ require (
4747
)
4848

4949
require (
50+
cel.dev/expr v0.18.0 // indirect
5051
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
5152
github.com/BurntSushi/toml v1.2.1 // indirect
5253
github.com/Microsoft/go-winio v0.6.2 // indirect
@@ -81,7 +82,6 @@ require (
8182
github.com/go-openapi/swag v0.23.1 // indirect
8283
github.com/gogo/protobuf v1.3.2 // indirect
8384
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
84-
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
8585
github.com/golang/protobuf v1.5.4 // indirect
8686
github.com/google/btree v1.0.1 // indirect
8787
github.com/google/cel-go v0.22.0 // indirect
@@ -96,7 +96,6 @@ require (
9696
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
9797
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
9898
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect
99-
github.com/imdario/mergo v0.3.13 // indirect
10099
github.com/inconshreveable/mousetrap v1.1.0 // indirect
101100
github.com/jonboulle/clockwork v0.4.0 // indirect
102101
github.com/josharian/intern v1.0.0 // indirect
@@ -107,6 +106,7 @@ require (
107106
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
108107
github.com/moby/spdystream v0.5.0 // indirect
109108
github.com/moby/sys/mountinfo v0.7.2 // indirect
109+
github.com/moby/sys/user v0.3.0 // indirect
110110
github.com/moby/term v0.5.0 // indirect
111111
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
112112
github.com/modern-go/reflect2 v1.0.2 // indirect
@@ -149,7 +149,6 @@ require (
149149
go.opentelemetry.io/otel/sdk v1.28.0 // indirect
150150
go.opentelemetry.io/otel/trace v1.28.0 // indirect
151151
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
152-
go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect
153152
go.uber.org/multierr v1.11.0 // indirect
154153
go.uber.org/zap v1.27.0 // indirect
155154
golang.org/x/crypto v0.36.0 // indirect
@@ -195,7 +194,7 @@ replace (
195194
k8s.io/api => k8s.io/api v0.32.1
196195
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.32.1
197196
k8s.io/apimachinery => k8s.io/apimachinery v0.32.1
198-
k8s.io/apiserver => github.com/openshift/kubernetes-apiserver v0.0.0-20250205074533-d8ec43992017 // points to openshift-apiserver-4.18-kubernetes-1.31.1
197+
k8s.io/apiserver => github.com/openshift/kubernetes-apiserver v0.0.0-20250116013846-c09fadd4305d // points to openshift-apiserver-4.19-kubernetes-1.32.1
199198
k8s.io/cli-runtime => k8s.io/cli-runtime v0.32.1
200199
k8s.io/client-go => k8s.io/client-go v0.32.1
201200
k8s.io/cloud-provider => k8s.io/cloud-provider v0.32.1

go.sum

+80-199
Large diffs are not rendered by default.

pkg/apps/apis/apps/v1/zz_generated.conversion.go

+198-198
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/apps/apis/apps/validation/validation.go

+37-8
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@ import (
77
"strconv"
88
"strings"
99

10+
"k8s.io/apimachinery/pkg/api/resource"
1011
apimachineryvalidation "k8s.io/apimachinery/pkg/api/validation"
1112
unversionedvalidation "k8s.io/apimachinery/pkg/apis/meta/v1/validation"
1213
"k8s.io/apimachinery/pkg/util/intstr"
1314
"k8s.io/apimachinery/pkg/util/sets"
1415
kvalidation "k8s.io/apimachinery/pkg/util/validation"
1516
"k8s.io/apimachinery/pkg/util/validation/field"
17+
1618
kapi "k8s.io/kubernetes/pkg/apis/core"
17-
"k8s.io/kubernetes/pkg/apis/core/validation"
19+
1820
kapivalidation "k8s.io/kubernetes/pkg/apis/core/validation"
1921

2022
"github.com/openshift/library-go/pkg/image/imageutil"
@@ -24,7 +26,7 @@ import (
2426
)
2527

2628
func ValidateDeploymentConfig(config *appsapi.DeploymentConfig) field.ErrorList {
27-
allErrs := validation.ValidateObjectMeta(&config.ObjectMeta, true, apimachineryvalidation.NameIsDNSSubdomain, field.NewPath("metadata"))
29+
allErrs := kapivalidation.ValidateObjectMeta(&config.ObjectMeta, true, apimachineryvalidation.NameIsDNSSubdomain, field.NewPath("metadata"))
2830
allErrs = append(allErrs, ValidateDeploymentConfigSpec(config.Spec)...)
2931
allErrs = append(allErrs, ValidateDeploymentConfigStatus(config.Status)...)
3032
return allErrs
@@ -70,7 +72,7 @@ func ValidateDeploymentConfigSpec(spec appsapi.DeploymentConfigSpec) field.Error
7072
originalContainerImageNames := getContainerImageNames(spec.Template)
7173
defer setContainerImageNames(spec.Template, originalContainerImageNames)
7274
handleEmptyImageReferences(spec.Template, spec.Triggers)
73-
allErrs = append(allErrs, validation.ValidatePodTemplateSpecForRC(spec.Template, spec.Selector, spec.Replicas, specPath.Child("template"), validation.PodValidationOptions{})...)
75+
allErrs = append(allErrs, kapivalidation.ValidatePodTemplateSpecForRC(spec.Template, spec.Selector, spec.Replicas, specPath.Child("template"), kapivalidation.PodValidationOptions{})...)
7476
}
7577
if spec.Replicas < 0 {
7678
allErrs = append(allErrs, field.Invalid(specPath.Child("replicas"), spec.Replicas, "replicas cannot be negative"))
@@ -151,14 +153,14 @@ func ValidateDeploymentConfigStatus(status appsapi.DeploymentConfigStatus) field
151153
}
152154

153155
func ValidateDeploymentConfigUpdate(newConfig *appsapi.DeploymentConfig, oldConfig *appsapi.DeploymentConfig) field.ErrorList {
154-
allErrs := validation.ValidateObjectMetaUpdate(&newConfig.ObjectMeta, &oldConfig.ObjectMeta, field.NewPath("metadata"))
156+
allErrs := kapivalidation.ValidateObjectMetaUpdate(&newConfig.ObjectMeta, &oldConfig.ObjectMeta, field.NewPath("metadata"))
155157
allErrs = append(allErrs, ValidateDeploymentConfig(newConfig)...)
156158
allErrs = append(allErrs, ValidateDeploymentConfigStatusUpdate(newConfig, oldConfig)...)
157159
return allErrs
158160
}
159161

160162
func ValidateDeploymentConfigStatusUpdate(newConfig *appsapi.DeploymentConfig, oldConfig *appsapi.DeploymentConfig) field.ErrorList {
161-
allErrs := validation.ValidateObjectMetaUpdate(&newConfig.ObjectMeta, &oldConfig.ObjectMeta, field.NewPath("metadata"))
163+
allErrs := kapivalidation.ValidateObjectMetaUpdate(&newConfig.ObjectMeta, &oldConfig.ObjectMeta, field.NewPath("metadata"))
162164
allErrs = append(allErrs, ValidateDeploymentConfigStatus(newConfig.Status)...)
163165
statusPath := field.NewPath("status")
164166
if newConfig.Status.LatestVersion < oldConfig.Status.LatestVersion {
@@ -248,7 +250,7 @@ func validateDeploymentStrategy(strategy *appsapi.DeploymentStrategy, pod *kapi.
248250
errs = append(errs, unversionedvalidation.ValidateLabels(strategy.Labels, fldPath.Child("labels"))...)
249251
}
250252
if strategy.Annotations != nil {
251-
errs = append(errs, validation.ValidateAnnotations(strategy.Annotations, fldPath.Child("annotations"))...)
253+
errs = append(errs, kapivalidation.ValidateAnnotations(strategy.Annotations, fldPath.Child("annotations"))...)
252254
}
253255

254256
podClaimNames := sets.New[string]()
@@ -258,7 +260,34 @@ func validateDeploymentStrategy(strategy *appsapi.DeploymentStrategy, pod *kapi.
258260
}
259261
}
260262

261-
errs = append(errs, validation.ValidateResourceRequirements(&strategy.Resources, podClaimNames, fldPath.Child("resources"), kapivalidation.PodValidationOptions{})...)
263+
if strategy.Resources.Limits != nil {
264+
for resourceName, quantity := range strategy.Resources.Limits {
265+
quota := &kapi.ResourceQuota{
266+
Spec: kapi.ResourceQuotaSpec{
267+
Hard: map[kapi.ResourceName]resource.Quantity{
268+
resourceName: quantity,
269+
},
270+
},
271+
}
272+
if errs = kapivalidation.ValidateResourceQuota(quota); len(errs) > 0 {
273+
errs = append(errs, errs...)
274+
}
275+
}
276+
}
277+
if strategy.Resources.Requests != nil {
278+
for resourceName, quantity := range strategy.Resources.Requests {
279+
quota := &kapi.ResourceQuota{
280+
Spec: kapi.ResourceQuotaSpec{
281+
Hard: map[kapi.ResourceName]resource.Quantity{
282+
resourceName: quantity,
283+
},
284+
},
285+
}
286+
if errs = kapivalidation.ValidateResourceQuota(quota); len(errs) > 0 {
287+
errs = append(errs, errs...)
288+
}
289+
}
290+
}
262291

263292
if strategy.ActiveDeadlineSeconds != nil {
264293
errs = append(errs, kapivalidation.ValidateNonnegativeField(*strategy.ActiveDeadlineSeconds, fldPath.Child("activeDeadlineSeconds"))...)
@@ -584,7 +613,7 @@ func ValidateDeploymentLogOptions(opts *appsapi.DeploymentLogOptions) field.Erro
584613

585614
// TODO: Replace by validating PodLogOptions via DeploymentLogOptions once it's bundled in
586615
popts := appsapi.DeploymentToPodLogOptions(opts)
587-
if errs := validation.ValidatePodLogOptions(popts); len(errs) > 0 {
616+
if errs := kapivalidation.ValidatePodLogOptions(popts, opts.Previous); len(errs) > 0 {
588617
allErrs = append(allErrs, errs...)
589618
}
590619

0 commit comments

Comments
 (0)