Skip to content

[WIP] OCPBUGS-45729: Updating ose-openshift-apiserver-container image to be consistent with ART for 4.19 #486

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .ci-operator.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
build_root_image:
name: release
namespace: openshift
tag: rhel-9-release-golang-1.22-openshift-4.18
tag: rhel-9-release-golang-1.23-openshift-4.19
265 changes: 134 additions & 131 deletions go.mod

Large diffs are not rendered by default.

454 changes: 218 additions & 236 deletions go.sum

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions images/Dockerfile.rhel
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.22-openshift-4.18 AS builder
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.23-openshift-4.19 AS builder
WORKDIR /go/src/github.com/openshift/openshift-apiserver
COPY . .
RUN make build --warn-undefined-variables

FROM registry.ci.openshift.org/ocp/4.18:base-rhel9
FROM registry.ci.openshift.org/ocp/4.19:base-rhel9
COPY --from=builder /go/src/github.com/openshift/openshift-apiserver/openshift-apiserver /usr/bin/
ENTRYPOINT ["/usr/bin/openshift-apiserver"]
LABEL io.k8s.display-name="OpenShift API Server Command" \
Expand Down
2 changes: 1 addition & 1 deletion pkg/apps/apis/apps/log_options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func TestLogOptionsDrift(t *testing.T) {
name := popts.Field(i).Name
doptsField, found := dopts.FieldByName(name)
// TODO: Add this option to deployment config log options
if name == "InsecureSkipTLSVerifyBackend" {
if name == "InsecureSkipTLSVerifyBackend" || name == "Stream" {
continue
}
if !found {
Expand Down
396 changes: 198 additions & 198 deletions pkg/apps/apis/apps/v1/zz_generated.conversion.go

Large diffs are not rendered by default.

45 changes: 37 additions & 8 deletions pkg/apps/apis/apps/validation/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ import (
"strconv"
"strings"

"k8s.io/apimachinery/pkg/api/resource"
apimachineryvalidation "k8s.io/apimachinery/pkg/api/validation"
unversionedvalidation "k8s.io/apimachinery/pkg/apis/meta/v1/validation"
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/apimachinery/pkg/util/sets"
kvalidation "k8s.io/apimachinery/pkg/util/validation"
"k8s.io/apimachinery/pkg/util/validation/field"

kapi "k8s.io/kubernetes/pkg/apis/core"
"k8s.io/kubernetes/pkg/apis/core/validation"

kapivalidation "k8s.io/kubernetes/pkg/apis/core/validation"

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

func ValidateDeploymentConfig(config *appsapi.DeploymentConfig) field.ErrorList {
allErrs := validation.ValidateObjectMeta(&config.ObjectMeta, true, apimachineryvalidation.NameIsDNSSubdomain, field.NewPath("metadata"))
allErrs := kapivalidation.ValidateObjectMeta(&config.ObjectMeta, true, apimachineryvalidation.NameIsDNSSubdomain, field.NewPath("metadata"))
allErrs = append(allErrs, ValidateDeploymentConfigSpec(config.Spec)...)
allErrs = append(allErrs, ValidateDeploymentConfigStatus(config.Status)...)
return allErrs
Expand Down Expand Up @@ -70,7 +72,7 @@ func ValidateDeploymentConfigSpec(spec appsapi.DeploymentConfigSpec) field.Error
originalContainerImageNames := getContainerImageNames(spec.Template)
defer setContainerImageNames(spec.Template, originalContainerImageNames)
handleEmptyImageReferences(spec.Template, spec.Triggers)
allErrs = append(allErrs, validation.ValidatePodTemplateSpecForRC(spec.Template, spec.Selector, spec.Replicas, specPath.Child("template"), validation.PodValidationOptions{})...)
allErrs = append(allErrs, kapivalidation.ValidatePodTemplateSpecForRC(spec.Template, spec.Selector, spec.Replicas, specPath.Child("template"), kapivalidation.PodValidationOptions{})...)
}
if spec.Replicas < 0 {
allErrs = append(allErrs, field.Invalid(specPath.Child("replicas"), spec.Replicas, "replicas cannot be negative"))
Expand Down Expand Up @@ -151,14 +153,14 @@ func ValidateDeploymentConfigStatus(status appsapi.DeploymentConfigStatus) field
}

func ValidateDeploymentConfigUpdate(newConfig *appsapi.DeploymentConfig, oldConfig *appsapi.DeploymentConfig) field.ErrorList {
allErrs := validation.ValidateObjectMetaUpdate(&newConfig.ObjectMeta, &oldConfig.ObjectMeta, field.NewPath("metadata"))
allErrs := kapivalidation.ValidateObjectMetaUpdate(&newConfig.ObjectMeta, &oldConfig.ObjectMeta, field.NewPath("metadata"))
allErrs = append(allErrs, ValidateDeploymentConfig(newConfig)...)
allErrs = append(allErrs, ValidateDeploymentConfigStatusUpdate(newConfig, oldConfig)...)
return allErrs
}

func ValidateDeploymentConfigStatusUpdate(newConfig *appsapi.DeploymentConfig, oldConfig *appsapi.DeploymentConfig) field.ErrorList {
allErrs := validation.ValidateObjectMetaUpdate(&newConfig.ObjectMeta, &oldConfig.ObjectMeta, field.NewPath("metadata"))
allErrs := kapivalidation.ValidateObjectMetaUpdate(&newConfig.ObjectMeta, &oldConfig.ObjectMeta, field.NewPath("metadata"))
allErrs = append(allErrs, ValidateDeploymentConfigStatus(newConfig.Status)...)
statusPath := field.NewPath("status")
if newConfig.Status.LatestVersion < oldConfig.Status.LatestVersion {
Expand Down Expand Up @@ -248,7 +250,7 @@ func validateDeploymentStrategy(strategy *appsapi.DeploymentStrategy, pod *kapi.
errs = append(errs, unversionedvalidation.ValidateLabels(strategy.Labels, fldPath.Child("labels"))...)
}
if strategy.Annotations != nil {
errs = append(errs, validation.ValidateAnnotations(strategy.Annotations, fldPath.Child("annotations"))...)
errs = append(errs, kapivalidation.ValidateAnnotations(strategy.Annotations, fldPath.Child("annotations"))...)
}

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

errs = append(errs, validation.ValidateResourceRequirements(&strategy.Resources, podClaimNames, fldPath.Child("resources"), kapivalidation.PodValidationOptions{})...)
if strategy.Resources.Limits != nil {
for resourceName, quantity := range strategy.Resources.Limits {
quota := &kapi.ResourceQuota{
Spec: kapi.ResourceQuotaSpec{
Hard: map[kapi.ResourceName]resource.Quantity{
resourceName: quantity,
},
},
}
if errs = kapivalidation.ValidateResourceQuota(quota); len(errs) > 0 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to ask why you added this block of code to validate resource limits? The func ValidateResourceQuota actually validate ObjectMeta as well which leads to all of failures on unit tests due to the fact this RQ object doesn't have name or namespace values which are required.

Also please separate the vendor code change to one commit and your own changes to another commit. This commit is so big. It is very hard to review as browser can't load such a big diff.

errs = append(errs, errs...)
}
}
}
if strategy.Resources.Requests != nil {
for resourceName, quantity := range strategy.Resources.Requests {
quota := &kapi.ResourceQuota{
Spec: kapi.ResourceQuotaSpec{
Hard: map[kapi.ResourceName]resource.Quantity{
resourceName: quantity,
},
},
}
if errs = kapivalidation.ValidateResourceQuota(quota); len(errs) > 0 {
errs = append(errs, errs...)
}
}
}

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

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

Expand Down
Loading