mirror of https://github.com/k3s-io/k3s
Merge pull request #67219 from seans3/rbac-dependency
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Move validation dependency from pkg/apis/core/validation to staging **What this PR does / why we need it**: Moves a dependency in metricsutil from `pkg/apis/core/validation` to the staging dependency. **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Helps Fix: **Remove Kubectl dependencies on kubernetes/pkg/api and kubernetes/pkg/apis** https://github.com/kubernetes/kubectl/issues/83 **Special notes for your reviewer**: ```release-note NONE ```pull/8/head
commit
8174d841f8
|
@ -14,10 +14,10 @@ go_library(
|
|||
"//build/visible_to:pkg_kubectl_metricsutil_CONSUMERS",
|
||||
],
|
||||
deps = [
|
||||
"//pkg/apis/core/validation:go_default_library",
|
||||
"//pkg/printers:go_default_library",
|
||||
"//staging/src/k8s.io/api/core/v1:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/api/validation:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
|
||||
|
|
|
@ -21,11 +21,11 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
|
||||
"k8s.io/apimachinery/pkg/api/validation"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
corev1client "k8s.io/client-go/kubernetes/typed/core/v1"
|
||||
"k8s.io/kubernetes/pkg/apis/core/validation"
|
||||
metricsapi "k8s.io/metrics/pkg/apis/metrics"
|
||||
metricsv1alpha1api "k8s.io/metrics/pkg/apis/metrics/v1alpha1"
|
||||
)
|
||||
|
@ -74,7 +74,7 @@ func podMetricsUrl(namespace string, name string) (string, error) {
|
|||
return "", errors.New(message)
|
||||
}
|
||||
if len(name) > 0 {
|
||||
errs = validation.ValidatePodName(name, false)
|
||||
errs = validation.NameIsDNSSubdomain(name, false)
|
||||
if len(errs) > 0 {
|
||||
message := fmt.Sprintf("invalid pod name: %s - %v", name, errs)
|
||||
return "", errors.New(message)
|
||||
|
@ -85,7 +85,7 @@ func podMetricsUrl(namespace string, name string) (string, error) {
|
|||
|
||||
func nodeMetricsUrl(name string) (string, error) {
|
||||
if len(name) > 0 {
|
||||
errs := validation.ValidateNodeName(name, false)
|
||||
errs := validation.NameIsDNSSubdomain(name, false)
|
||||
if len(errs) > 0 {
|
||||
message := fmt.Sprintf("invalid node name: %s - %v", name, errs)
|
||||
return "", errors.New(message)
|
||||
|
|
Loading…
Reference in New Issue