mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
Rename IsEmpty to Empty
Signed-off-by: Kara Alexandra <kalexandra@us.ibm.com>
This commit is contained in:
@@ -329,9 +329,9 @@ func NewGenericServerResponse(code int, verb string, qualifiedResource unversion
|
||||
}
|
||||
}
|
||||
switch {
|
||||
case !qualifiedResource.IsEmpty() && len(name) > 0:
|
||||
case !qualifiedResource.Empty() && len(name) > 0:
|
||||
message = fmt.Sprintf("%s (%s %s %s)", message, strings.ToLower(verb), qualifiedResource.String(), name)
|
||||
case !qualifiedResource.IsEmpty():
|
||||
case !qualifiedResource.Empty():
|
||||
message = fmt.Sprintf("%s (%s %s)", message, strings.ToLower(verb), qualifiedResource.String())
|
||||
}
|
||||
var causes []unversioned.StatusCause
|
||||
|
||||
@@ -183,7 +183,7 @@ func (m *DefaultRESTMapper) ResourceSingularizer(resourceType string) (string, e
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
if singular.IsEmpty() {
|
||||
if singular.Empty() {
|
||||
singular = currSingular
|
||||
continue
|
||||
}
|
||||
@@ -193,7 +193,7 @@ func (m *DefaultRESTMapper) ResourceSingularizer(resourceType string) (string, e
|
||||
}
|
||||
}
|
||||
|
||||
if singular.IsEmpty() {
|
||||
if singular.Empty() {
|
||||
return resourceType, fmt.Errorf("no singular of resource %v has been defined", resourceType)
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ func (gr GroupResource) WithVersion(version string) GroupVersionResource {
|
||||
return GroupVersionResource{Group: gr.Group, Version: version, Resource: gr.Resource}
|
||||
}
|
||||
|
||||
func (gr GroupResource) IsEmpty() bool {
|
||||
func (gr GroupResource) Empty() bool {
|
||||
return len(gr.Group) == 0 && len(gr.Resource) == 0
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ type GroupVersionResource struct {
|
||||
Resource string `protobuf:"bytes,3,opt,name=resource"`
|
||||
}
|
||||
|
||||
func (gvr GroupVersionResource) IsEmpty() bool {
|
||||
func (gvr GroupVersionResource) Empty() bool {
|
||||
return len(gvr.Group) == 0 && len(gvr.Version) == 0 && len(gvr.Resource) == 0
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ type GroupKind struct {
|
||||
Kind string `protobuf:"bytes,2,opt,name=kind"`
|
||||
}
|
||||
|
||||
func (gk GroupKind) IsEmpty() bool {
|
||||
func (gk GroupKind) Empty() bool {
|
||||
return len(gk.Group) == 0 && len(gk.Kind) == 0
|
||||
}
|
||||
|
||||
@@ -131,8 +131,8 @@ type GroupVersionKind struct {
|
||||
Kind string `protobuf:"bytes,3,opt,name=kind"`
|
||||
}
|
||||
|
||||
// IsEmpty returns true if group, version, and kind are empty
|
||||
func (gvk GroupVersionKind) IsEmpty() bool {
|
||||
// Empty returns true if group, version, and kind are empty
|
||||
func (gvk GroupVersionKind) Empty() bool {
|
||||
return len(gvk.Group) == 0 && len(gvk.Version) == 0 && len(gvk.Kind) == 0
|
||||
}
|
||||
|
||||
@@ -156,8 +156,8 @@ type GroupVersion struct {
|
||||
Version string `protobuf:"bytes,2,opt,name=version"`
|
||||
}
|
||||
|
||||
// IsEmpty returns true if group and version are empty
|
||||
func (gv GroupVersion) IsEmpty() bool {
|
||||
// Empty returns true if group and version are empty
|
||||
func (gv GroupVersion) Empty() bool {
|
||||
return len(gv.Group) == 0 && len(gv.Version) == 0
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ func (gv GroupVersion) IsEmpty() bool {
|
||||
// it returns "v1".
|
||||
func (gv GroupVersion) String() string {
|
||||
// special case the internal apiVersion for the legacy kube types
|
||||
if gv.IsEmpty() {
|
||||
if gv.Empty() {
|
||||
return ""
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user