Skip to content

Commit

Permalink
UPSTREAM: <carry>: Fix incorrect type casting in admission validate_a…
Browse files Browse the repository at this point in the history
…piserver

Signed-off-by: Swarup Ghosh <swghosh@redhat.com>
  • Loading branch information
swghosh committed Apr 12, 2024
1 parent cdb8ea7 commit 66a2a96
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
configv1 "github.com/openshift/api/config/v1"
configv1client "github.com/openshift/client-go/config/clientset/versioned/typed/config/v1"
"github.com/openshift/library-go/pkg/apiserver/admission/admissionrestconfig"
"k8s.io/klog/v2"
"k8s.io/kubernetes/openshift-kube-apiserver/admission/customresourcevalidation"

"k8s.io/apimachinery/pkg/runtime/schema"
Expand Down Expand Up @@ -45,6 +46,7 @@ func NewValidateAPIServer() (admission.Interface, error) {
}
ret.ValidationInterface = delegate

defer klog.V(2).Infof("%s constructed Route validation client", PluginName)
return ret, nil
}

Expand All @@ -68,9 +70,6 @@ func (a *validateCustomResourceWithClient) ValidateInitialization() error {
return fmt.Errorf(PluginName + " needs an infrastructureGetter")
}

if initializationValidator, ok := a.ValidationInterface.(admission.InitializationValidator); ok {
return initializationValidator.ValidateInitialization()
}

klog.V(2).Infof("%s validator initialization successful", PluginName)
return nil
}

0 comments on commit 66a2a96

Please sign in to comment.