Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
96a8ff6b
Commit
96a8ff6b
authored
Dec 06, 2017
by
linweibin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused code in pkg/api/,pkg/apis/
parent
64ed037e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
0 additions
and
51 deletions
+0
-51
BUILD
pkg/api/resource/BUILD
+0
-1
helpers_test.go
pkg/api/resource/helpers_test.go
+0
-20
BUILD
pkg/api/testing/BUILD
+0
-1
serialization_test.go
pkg/api/testing/serialization_test.go
+0
-13
validation.go
pkg/apis/core/validation/validation.go
+0
-9
validation_test.go
pkg/apis/extensions/validation/validation_test.go
+0
-7
No files found.
pkg/api/resource/BUILD
View file @
96a8ff6b
...
@@ -37,6 +37,5 @@ go_test(
...
@@ -37,6 +37,5 @@ go_test(
deps = [
deps = [
"//pkg/apis/core:go_default_library",
"//pkg/apis/core:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
],
],
)
)
pkg/api/resource/helpers_test.go
View file @
96a8ff6b
...
@@ -18,10 +18,8 @@ package resource
...
@@ -18,10 +18,8 @@ package resource
import
(
import
(
"testing"
"testing"
"time"
"k8s.io/apimachinery/pkg/api/resource"
"k8s.io/apimachinery/pkg/api/resource"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
api
"k8s.io/kubernetes/pkg/apis/core"
api
"k8s.io/kubernetes/pkg/apis/core"
)
)
...
@@ -62,21 +60,3 @@ func TestDefaultResourceHelpers(t *testing.T) {
...
@@ -62,21 +60,3 @@ func TestDefaultResourceHelpers(t *testing.T) {
t
.
Errorf
(
"expected %v, actual %v"
,
resource
.
BinarySI
,
resourceList
.
Memory
()
.
Format
)
t
.
Errorf
(
"expected %v, actual %v"
,
resource
.
BinarySI
,
resourceList
.
Memory
()
.
Format
)
}
}
}
}
func
newPod
(
now
metav1
.
Time
,
ready
bool
,
beforeSec
int
)
*
api
.
Pod
{
conditionStatus
:=
api
.
ConditionFalse
if
ready
{
conditionStatus
=
api
.
ConditionTrue
}
return
&
api
.
Pod
{
Status
:
api
.
PodStatus
{
Conditions
:
[]
api
.
PodCondition
{
{
Type
:
api
.
PodReady
,
LastTransitionTime
:
metav1
.
NewTime
(
now
.
Time
.
Add
(
-
1
*
time
.
Duration
(
beforeSec
)
*
time
.
Second
)),
Status
:
conditionStatus
,
},
},
},
}
}
pkg/api/testing/BUILD
View file @
96a8ff6b
...
@@ -85,7 +85,6 @@ go_test(
...
@@ -85,7 +85,6 @@ go_test(
"//pkg/apis/extensions:go_default_library",
"//pkg/apis/extensions:go_default_library",
"//pkg/apis/extensions/v1beta1:go_default_library",
"//pkg/apis/extensions/v1beta1:go_default_library",
"//vendor/github.com/gogo/protobuf/proto:go_default_library",
"//vendor/github.com/gogo/protobuf/proto:go_default_library",
"//vendor/github.com/golang/protobuf/proto:go_default_library",
"//vendor/github.com/google/gofuzz:go_default_library",
"//vendor/github.com/google/gofuzz:go_default_library",
"//vendor/github.com/json-iterator/go:go_default_library",
"//vendor/github.com/json-iterator/go:go_default_library",
"//vendor/k8s.io/api/core/v1:go_default_library",
"//vendor/k8s.io/api/core/v1:go_default_library",
...
...
pkg/api/testing/serialization_test.go
View file @
96a8ff6b
...
@@ -23,10 +23,8 @@ import (
...
@@ -23,10 +23,8 @@ import (
"io/ioutil"
"io/ioutil"
"math/rand"
"math/rand"
"reflect"
"reflect"
"strings"
"testing"
"testing"
"github.com/golang/protobuf/proto"
jsoniter
"github.com/json-iterator/go"
jsoniter
"github.com/json-iterator/go"
"k8s.io/api/core/v1"
"k8s.io/api/core/v1"
...
@@ -66,17 +64,6 @@ func fuzzInternalObject(t *testing.T, forVersion schema.GroupVersion, item runti
...
@@ -66,17 +64,6 @@ func fuzzInternalObject(t *testing.T, forVersion schema.GroupVersion, item runti
return
item
return
item
}
}
// dataAsString returns the given byte array as a string; handles detecting
// protocol buffers.
func
dataAsString
(
data
[]
byte
)
string
{
dataString
:=
string
(
data
)
if
!
strings
.
HasPrefix
(
dataString
,
"{"
)
{
dataString
=
"
\n
"
+
hex
.
Dump
(
data
)
proto
.
NewBuffer
(
make
([]
byte
,
0
,
1024
))
.
DebugPrint
(
"decoded object"
,
data
)
}
return
dataString
}
func
Convert_v1beta1_ReplicaSet_to_api_ReplicationController
(
in
*
v1beta1
.
ReplicaSet
,
out
*
api
.
ReplicationController
,
s
conversion
.
Scope
)
error
{
func
Convert_v1beta1_ReplicaSet_to_api_ReplicationController
(
in
*
v1beta1
.
ReplicaSet
,
out
*
api
.
ReplicationController
,
s
conversion
.
Scope
)
error
{
intermediate1
:=
&
extensions
.
ReplicaSet
{}
intermediate1
:=
&
extensions
.
ReplicaSet
{}
if
err
:=
k8s_v1beta1
.
Convert_v1beta1_ReplicaSet_To_extensions_ReplicaSet
(
in
,
intermediate1
,
s
);
err
!=
nil
{
if
err
:=
k8s_v1beta1
.
Convert_v1beta1_ReplicaSet_To_extensions_ReplicaSet
(
in
,
intermediate1
,
s
);
err
!=
nil
{
...
...
pkg/apis/core/validation/validation.go
View file @
96a8ff6b
...
@@ -212,15 +212,6 @@ func ValidateOwnerReferences(ownerReferences []metav1.OwnerReference, fldPath *f
...
@@ -212,15 +212,6 @@ func ValidateOwnerReferences(ownerReferences []metav1.OwnerReference, fldPath *f
// value that were not valid. Otherwise this returns an empty list or nil.
// value that were not valid. Otherwise this returns an empty list or nil.
type
ValidateNameFunc
apimachineryvalidation
.
ValidateNameFunc
type
ValidateNameFunc
apimachineryvalidation
.
ValidateNameFunc
// maskTrailingDash replaces the final character of a string with a subdomain safe
// value if is a dash.
func
maskTrailingDash
(
name
string
)
string
{
if
strings
.
HasSuffix
(
name
,
"-"
)
{
return
name
[
:
len
(
name
)
-
2
]
+
"a"
}
return
name
}
// ValidatePodName can be used to check whether the given pod name is valid.
// ValidatePodName can be used to check whether the given pod name is valid.
// Prefix indicates this name will be used as part of generation, in which case
// Prefix indicates this name will be used as part of generation, in which case
// trailing dashes are allowed.
// trailing dashes are allowed.
...
...
pkg/apis/extensions/validation/validation_test.go
View file @
96a8ff6b
...
@@ -1232,11 +1232,6 @@ func TestValidateDeployment(t *testing.T) {
...
@@ -1232,11 +1232,6 @@ func TestValidateDeployment(t *testing.T) {
}
}
}
}
func
int64p
(
i
int
)
*
int64
{
i64
:=
int64
(
i
)
return
&
i64
}
func
TestValidateDeploymentStatus
(
t
*
testing
.
T
)
{
func
TestValidateDeploymentStatus
(
t
*
testing
.
T
)
{
collisionCount
:=
int32
(
-
3
)
collisionCount
:=
int32
(
-
3
)
tests
:=
[]
struct
{
tests
:=
[]
struct
{
...
@@ -1473,8 +1468,6 @@ func TestValidateDeploymentRollback(t *testing.T) {
...
@@ -1473,8 +1468,6 @@ func TestValidateDeploymentRollback(t *testing.T) {
}
}
}
}
type
ingressRules
map
[
string
]
string
func
TestValidateIngress
(
t
*
testing
.
T
)
{
func
TestValidateIngress
(
t
*
testing
.
T
)
{
defaultBackend
:=
extensions
.
IngressBackend
{
defaultBackend
:=
extensions
.
IngressBackend
{
ServiceName
:
"default-backend"
,
ServiceName
:
"default-backend"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment