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
bcde0575
Unverified
Commit
bcde0575
authored
Jan 14, 2017
by
Clayton Coleman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct import statements
parent
66009577
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
36 additions
and
92 deletions
+36
-92
BUILD
examples/https-nginx/BUILD
+1
-0
make_secret.go
examples/https-nginx/make_secret.go
+2
-1
BUILD
examples/sharing-clusters/BUILD
+1
-0
make_secret.go
examples/sharing-clusters/make_secret.go
+2
-1
daemoncontroller_test.go
pkg/controller/daemon/daemoncontroller_test.go
+2
-1
horizontal_test.go
pkg/controller/podautoscaler/horizontal_test.go
+1
-1
metrics_client_test.go
pkg/controller/podautoscaler/metrics/metrics_client_test.go
+1
-1
metrics_client_test.go.rej
...ntroller/podautoscaler/metrics/metrics_client_test.go.rej
+0
-11
replica_calculator_test.go
pkg/controller/podautoscaler/replica_calculator_test.go
+1
-1
taint.go
pkg/kubectl/cmd/taint.go
+1
-1
top_pod_test.go
pkg/kubectl/cmd/top_pod_test.go
+3
-4
top_test.go
pkg/kubectl/cmd/top_test.go
+2
-2
import_known_versions_test.go
pkg/master/import_known_versions_test.go
+1
-0
admission.go
plugin/pkg/admission/imagepolicy/admission.go
+1
-1
policy.go
plugin/pkg/auth/authorizer/rbac/bootstrappolicy/policy.go
+2
-2
predicates_test.go
plugin/pkg/scheduler/algorithm/predicates/predicates_test.go
+8
-8
generate_test.go
...g/src/k8s.io/apiserver/pkg/storage/names/generate_test.go
+3
-53
webhook.go
staging/src/k8s.io/apiserver/pkg/webhook/webhook.go
+1
-1
cauldron.go
test/soak/cauldron/cauldron.go
+3
-3
No files found.
examples/https-nginx/BUILD
View file @
bcde0575
...
@@ -21,6 +21,7 @@ go_library(
...
@@ -21,6 +21,7 @@ go_library(
deps = [
deps = [
"//pkg/api:go_default_library",
"//pkg/api:go_default_library",
"//pkg/api/install:go_default_library",
"//pkg/api/install:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/runtime",
"//vendor:k8s.io/apimachinery/pkg/runtime",
],
],
)
)
...
...
examples/https-nginx/make_secret.go
View file @
bcde0575
...
@@ -26,6 +26,7 @@ import (
...
@@ -26,6 +26,7 @@ import (
"io/ioutil"
"io/ioutil"
"log"
"log"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api"
...
@@ -57,7 +58,7 @@ func main() {
...
@@ -57,7 +58,7 @@ func main() {
nginxCrt
:=
read
(
*
crt
)
nginxCrt
:=
read
(
*
crt
)
nginxKey
:=
read
(
*
key
)
nginxKey
:=
read
(
*
key
)
secret
:=
&
api
.
Secret
{
secret
:=
&
api
.
Secret
{
ObjectMeta
:
api
.
ObjectMeta
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
"nginxsecret"
,
Name
:
"nginxsecret"
,
},
},
Data
:
map
[
string
][]
byte
{
Data
:
map
[
string
][]
byte
{
...
...
examples/sharing-clusters/BUILD
View file @
bcde0575
...
@@ -20,6 +20,7 @@ go_library(
...
@@ -20,6 +20,7 @@ go_library(
tags = ["automanaged"],
tags = ["automanaged"],
deps = [
deps = [
"//pkg/api:go_default_library",
"//pkg/api:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/runtime",
"//vendor:k8s.io/apimachinery/pkg/runtime",
],
],
)
)
...
...
examples/sharing-clusters/make_secret.go
View file @
bcde0575
...
@@ -23,6 +23,7 @@ import (
...
@@ -23,6 +23,7 @@ import (
"io/ioutil"
"io/ioutil"
"log"
"log"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api"
)
)
...
@@ -50,7 +51,7 @@ func main() {
...
@@ -50,7 +51,7 @@ func main() {
}
}
cfg
:=
read
(
*
kubeconfig
)
cfg
:=
read
(
*
kubeconfig
)
secret
:=
&
api
.
Secret
{
secret
:=
&
api
.
Secret
{
ObjectMeta
:
api
.
ObjectMeta
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
*
name
,
Name
:
*
name
,
Namespace
:
*
ns
,
Namespace
:
*
ns
,
},
},
...
...
pkg/controller/daemon/daemoncontroller_test.go
View file @
bcde0575
...
@@ -22,6 +22,7 @@ import (
...
@@ -22,6 +22,7 @@ import (
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apiserver/pkg/storage/names"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/resource"
"k8s.io/kubernetes/pkg/api/resource"
"k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/pkg/api/testapi"
...
@@ -127,7 +128,7 @@ func newPod(podName string, nodeName string, label map[string]string) *v1.Pod {
...
@@ -127,7 +128,7 @@ func newPod(podName string, nodeName string, label map[string]string) *v1.Pod {
DNSPolicy
:
v1
.
DNSDefault
,
DNSPolicy
:
v1
.
DNSDefault
,
},
},
}
}
metav1
.
GenerateName
(
v1
.
SimpleNameGenerator
,
&
pod
.
ObjectMeta
)
pod
.
Name
=
names
.
SimpleNameGenerator
.
GenerateName
(
podName
)
return
pod
return
pod
}
}
...
...
pkg/controller/podautoscaler/horizontal_test.go
View file @
bcde0575
...
@@ -304,7 +304,7 @@ func (tc *testCase) prepareTestClient(t *testing.T) *fake.Clientset {
...
@@ -304,7 +304,7 @@ func (tc *testCase) prepareTestClient(t *testing.T) *fake.Clientset {
metrics
:=
metricsapi
.
PodMetricsList
{}
metrics
:=
metricsapi
.
PodMetricsList
{}
for
i
,
cpu
:=
range
tc
.
reportedLevels
{
for
i
,
cpu
:=
range
tc
.
reportedLevels
{
podMetric
:=
metricsapi
.
PodMetrics
{
podMetric
:=
metricsapi
.
PodMetrics
{
ObjectMeta
:
meta
v1
.
ObjectMeta
{
ObjectMeta
:
v1
.
ObjectMeta
{
Name
:
fmt
.
Sprintf
(
"%s-%d"
,
podNamePrefix
,
i
),
Name
:
fmt
.
Sprintf
(
"%s-%d"
,
podNamePrefix
,
i
),
Namespace
:
namespace
,
Namespace
:
namespace
,
},
},
...
...
pkg/controller/podautoscaler/metrics/metrics_client_test.go
View file @
bcde0575
...
@@ -106,7 +106,7 @@ func (tc *testCase) prepareTestClient(t *testing.T) *fake.Clientset {
...
@@ -106,7 +106,7 @@ func (tc *testCase) prepareTestClient(t *testing.T) *fake.Clientset {
metrics
:=
metricsapi
.
PodMetricsList
{}
metrics
:=
metricsapi
.
PodMetricsList
{}
for
i
,
containers
:=
range
tc
.
reportedPodMetrics
{
for
i
,
containers
:=
range
tc
.
reportedPodMetrics
{
metric
:=
metricsapi
.
PodMetrics
{
metric
:=
metricsapi
.
PodMetrics
{
ObjectMeta
:
meta
v1
.
ObjectMeta
{
ObjectMeta
:
v1
.
ObjectMeta
{
Name
:
fmt
.
Sprintf
(
"%s-%d"
,
podNamePrefix
,
i
),
Name
:
fmt
.
Sprintf
(
"%s-%d"
,
podNamePrefix
,
i
),
Namespace
:
namespace
,
Namespace
:
namespace
,
},
},
...
...
pkg/controller/podautoscaler/metrics/metrics_client_test.go.rej
deleted
100644 → 0
View file @
66009577
--- pkg/controller/podautoscaler/metrics/metrics_client_test.go
+++ pkg/controller/podautoscaler/metrics/metrics_client_test.go
@@ -110,7 +110,7 @@ func (tc *testCase) prepareTestClient(t *testing.T) *fake.Clientset {
Name: fmt.Sprintf("%s-%d", podNamePrefix, i),
Namespace: namespace,
},
- Timestamp: metav1.Time{Time: fixedTimestamp.Add(time.Duration(tc.targetTimestamp) * time.Minute)},
+ Timestamp: unversioned.Time{Time: fixedTimestamp.Add(time.Duration(tc.targetTimestamp) * time.Minute)},
Containers: []metrics_api.ContainerMetrics{},
}
for j, cpu := range containers {
pkg/controller/podautoscaler/replica_calculator_test.go
View file @
bcde0575
...
@@ -140,7 +140,7 @@ func (tc *replicaCalcTestCase) prepareTestClient(t *testing.T) *fake.Clientset {
...
@@ -140,7 +140,7 @@ func (tc *replicaCalcTestCase) prepareTestClient(t *testing.T) *fake.Clientset {
podName
=
tc
.
resource
.
podNames
[
i
]
podName
=
tc
.
resource
.
podNames
[
i
]
}
}
podMetric
:=
metricsapi
.
PodMetrics
{
podMetric
:=
metricsapi
.
PodMetrics
{
ObjectMeta
:
meta
v1
.
ObjectMeta
{
ObjectMeta
:
v1
.
ObjectMeta
{
Name
:
podName
,
Name
:
podName
,
Namespace
:
testNamespace
,
Namespace
:
testNamespace
,
},
},
...
...
pkg/kubectl/cmd/taint.go
View file @
bcde0575
...
@@ -26,13 +26,13 @@ import (
...
@@ -26,13 +26,13 @@ import (
"github.com/golang/glog"
"github.com/golang/glog"
"github.com/spf13/cobra"
"github.com/spf13/cobra"
"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/api/meta"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/types"
utilerrors
"k8s.io/apimachinery/pkg/util/errors"
utilerrors
"k8s.io/apimachinery/pkg/util/errors"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apimachinery/pkg/util/validation"
"k8s.io/apimachinery/pkg/util/validation"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/kubectl"
"k8s.io/kubernetes/pkg/kubectl"
"k8s.io/kubernetes/pkg/kubectl/cmd/templates"
"k8s.io/kubernetes/pkg/kubectl/cmd/templates"
cmdutil
"k8s.io/kubernetes/pkg/kubectl/cmd/util"
cmdutil
"k8s.io/kubernetes/pkg/kubectl/cmd/util"
...
...
pkg/kubectl/cmd/top_pod_test.go
View file @
bcde0575
...
@@ -25,7 +25,6 @@ import (
...
@@ -25,7 +25,6 @@ import (
"net/url"
"net/url"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
metricsapi
"k8s.io/heapster/metrics/apis/metrics/v1alpha1"
metricsapi
"k8s.io/heapster/metrics/apis/metrics/v1alpha1"
"k8s.io/kubernetes/pkg/api/resource"
"k8s.io/kubernetes/pkg/api/resource"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/api/unversioned"
...
@@ -172,7 +171,7 @@ func TestTopPod(t *testing.T) {
...
@@ -172,7 +171,7 @@ func TestTopPod(t *testing.T) {
func
testPodMetricsData
()
[]
metricsapi
.
PodMetrics
{
func
testPodMetricsData
()
[]
metricsapi
.
PodMetrics
{
return
[]
metricsapi
.
PodMetrics
{
return
[]
metricsapi
.
PodMetrics
{
{
{
ObjectMeta
:
meta
v1
.
ObjectMeta
{
Name
:
"pod1"
,
Namespace
:
"test"
,
ResourceVersion
:
"10"
},
ObjectMeta
:
v1
.
ObjectMeta
{
Name
:
"pod1"
,
Namespace
:
"test"
,
ResourceVersion
:
"10"
},
Window
:
unversioned
.
Duration
{
Duration
:
time
.
Minute
},
Window
:
unversioned
.
Duration
{
Duration
:
time
.
Minute
},
Containers
:
[]
metricsapi
.
ContainerMetrics
{
Containers
:
[]
metricsapi
.
ContainerMetrics
{
{
{
...
@@ -194,7 +193,7 @@ func testPodMetricsData() []metricsapi.PodMetrics {
...
@@ -194,7 +193,7 @@ func testPodMetricsData() []metricsapi.PodMetrics {
},
},
},
},
{
{
ObjectMeta
:
meta
v1
.
ObjectMeta
{
Name
:
"pod2"
,
Namespace
:
"test"
,
ResourceVersion
:
"11"
},
ObjectMeta
:
v1
.
ObjectMeta
{
Name
:
"pod2"
,
Namespace
:
"test"
,
ResourceVersion
:
"11"
},
Window
:
unversioned
.
Duration
{
Duration
:
time
.
Minute
},
Window
:
unversioned
.
Duration
{
Duration
:
time
.
Minute
},
Containers
:
[]
metricsapi
.
ContainerMetrics
{
Containers
:
[]
metricsapi
.
ContainerMetrics
{
{
{
...
@@ -224,7 +223,7 @@ func testPodMetricsData() []metricsapi.PodMetrics {
...
@@ -224,7 +223,7 @@ func testPodMetricsData() []metricsapi.PodMetrics {
},
},
},
},
{
{
ObjectMeta
:
meta
v1
.
ObjectMeta
{
Name
:
"pod3"
,
Namespace
:
"test"
,
ResourceVersion
:
"12"
},
ObjectMeta
:
v1
.
ObjectMeta
{
Name
:
"pod3"
,
Namespace
:
"test"
,
ResourceVersion
:
"12"
},
Window
:
unversioned
.
Duration
{
Duration
:
time
.
Minute
},
Window
:
unversioned
.
Duration
{
Duration
:
time
.
Minute
},
Containers
:
[]
metricsapi
.
ContainerMetrics
{
Containers
:
[]
metricsapi
.
ContainerMetrics
{
{
{
...
...
pkg/kubectl/cmd/top_test.go
View file @
bcde0575
...
@@ -67,7 +67,7 @@ func testNodeMetricsData() (*metricsapi.NodeMetricsList, *api.NodeList) {
...
@@ -67,7 +67,7 @@ func testNodeMetricsData() (*metricsapi.NodeMetricsList, *api.NodeList) {
},
},
Items
:
[]
metricsapi
.
NodeMetrics
{
Items
:
[]
metricsapi
.
NodeMetrics
{
{
{
ObjectMeta
:
meta
v1
.
ObjectMeta
{
Name
:
"node1"
,
ResourceVersion
:
"10"
},
ObjectMeta
:
v1
.
ObjectMeta
{
Name
:
"node1"
,
ResourceVersion
:
"10"
},
Window
:
unversioned
.
Duration
{
Duration
:
time
.
Minute
},
Window
:
unversioned
.
Duration
{
Duration
:
time
.
Minute
},
Usage
:
v1
.
ResourceList
{
Usage
:
v1
.
ResourceList
{
v1
.
ResourceCPU
:
*
resource
.
NewMilliQuantity
(
1
,
resource
.
DecimalSI
),
v1
.
ResourceCPU
:
*
resource
.
NewMilliQuantity
(
1
,
resource
.
DecimalSI
),
...
@@ -76,7 +76,7 @@ func testNodeMetricsData() (*metricsapi.NodeMetricsList, *api.NodeList) {
...
@@ -76,7 +76,7 @@ func testNodeMetricsData() (*metricsapi.NodeMetricsList, *api.NodeList) {
},
},
},
},
{
{
ObjectMeta
:
meta
v1
.
ObjectMeta
{
Name
:
"node2"
,
ResourceVersion
:
"11"
},
ObjectMeta
:
v1
.
ObjectMeta
{
Name
:
"node2"
,
ResourceVersion
:
"11"
},
Window
:
unversioned
.
Duration
{
Duration
:
time
.
Minute
},
Window
:
unversioned
.
Duration
{
Duration
:
time
.
Minute
},
Usage
:
v1
.
ResourceList
{
Usage
:
v1
.
ResourceList
{
v1
.
ResourceCPU
:
*
resource
.
NewMilliQuantity
(
5
,
resource
.
DecimalSI
),
v1
.
ResourceCPU
:
*
resource
.
NewMilliQuantity
(
5
,
resource
.
DecimalSI
),
...
...
pkg/master/import_known_versions_test.go
View file @
bcde0575
...
@@ -76,6 +76,7 @@ var typesAllowedTags = map[reflect.Type]bool{
...
@@ -76,6 +76,7 @@ var typesAllowedTags = map[reflect.Type]bool{
reflect
.
TypeOf
(
metav1
.
Duration
{})
:
true
,
reflect
.
TypeOf
(
metav1
.
Duration
{})
:
true
,
reflect
.
TypeOf
(
metav1
.
TypeMeta
{})
:
true
,
reflect
.
TypeOf
(
metav1
.
TypeMeta
{})
:
true
,
reflect
.
TypeOf
(
metav1
.
ListMeta
{})
:
true
,
reflect
.
TypeOf
(
metav1
.
ListMeta
{})
:
true
,
reflect
.
TypeOf
(
metav1
.
ObjectMeta
{})
:
true
,
reflect
.
TypeOf
(
metav1
.
OwnerReference
{})
:
true
,
reflect
.
TypeOf
(
metav1
.
OwnerReference
{})
:
true
,
reflect
.
TypeOf
(
metav1
.
LabelSelector
{})
:
true
,
reflect
.
TypeOf
(
metav1
.
LabelSelector
{})
:
true
,
reflect
.
TypeOf
(
metav1
.
GetOptions
{})
:
true
,
reflect
.
TypeOf
(
metav1
.
GetOptions
{})
:
true
,
...
...
plugin/pkg/admission/imagepolicy/admission.go
View file @
bcde0575
...
@@ -28,12 +28,12 @@ import (
...
@@ -28,12 +28,12 @@ import (
"github.com/golang/glog"
"github.com/golang/glog"
apierrors
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/runtime/schema"
kubeschema
"k8s.io/apimachinery/pkg/runtime/schema"
kubeschema
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/util/yaml"
"k8s.io/apimachinery/pkg/util/yaml"
"k8s.io/apiserver/pkg/util/cache"
"k8s.io/apiserver/pkg/util/cache"
"k8s.io/apiserver/pkg/webhook"
"k8s.io/apiserver/pkg/webhook"
apierrors
"k8s.io/client-go/pkg/api/errors"
"k8s.io/client-go/pkg/apis/imagepolicy/v1alpha1"
"k8s.io/client-go/pkg/apis/imagepolicy/v1alpha1"
"k8s.io/client-go/rest"
"k8s.io/client-go/rest"
"k8s.io/kubernetes/pkg/admission"
"k8s.io/kubernetes/pkg/admission"
...
...
plugin/pkg/auth/authorizer/rbac/bootstrappolicy/policy.go
View file @
bcde0575
...
@@ -173,7 +173,7 @@ func ClusterRoles() []rbac.ClusterRole {
...
@@ -173,7 +173,7 @@ func ClusterRoles() []rbac.ClusterRole {
},
},
{
{
// a role to use for heapster's connections back to the API server
// a role to use for heapster's connections back to the API server
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"system:heapster"
},
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
"system:heapster"
},
Rules
:
[]
rbac
.
PolicyRule
{
Rules
:
[]
rbac
.
PolicyRule
{
rbac
.
NewRule
(
Read
...
)
.
Groups
(
legacyGroup
)
.
Resources
(
"events"
,
"pods"
,
"nodes"
,
"namespaces"
)
.
RuleOrDie
(),
rbac
.
NewRule
(
Read
...
)
.
Groups
(
legacyGroup
)
.
Resources
(
"events"
,
"pods"
,
"nodes"
,
"namespaces"
)
.
RuleOrDie
(),
},
},
...
@@ -232,7 +232,7 @@ func ClusterRoles() []rbac.ClusterRole {
...
@@ -232,7 +232,7 @@ func ClusterRoles() []rbac.ClusterRole {
},
},
{
{
// a role to use for bootstrapping a node's client certificates
// a role to use for bootstrapping a node's client certificates
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"system:node-bootstrapper"
},
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
"system:node-bootstrapper"
},
Rules
:
[]
rbac
.
PolicyRule
{
Rules
:
[]
rbac
.
PolicyRule
{
// used to check if the node already exists
// used to check if the node already exists
rbac
.
NewRule
(
"get"
)
.
Groups
(
legacyGroup
)
.
Resources
(
"nodes"
)
.
RuleOrDie
(),
rbac
.
NewRule
(
"get"
)
.
Groups
(
legacyGroup
)
.
Resources
(
"nodes"
)
.
RuleOrDie
(),
...
...
plugin/pkg/scheduler/algorithm/predicates/predicates_test.go
View file @
bcde0575
...
@@ -2824,7 +2824,7 @@ func TestInterPodAffinityWithMultipleNodes(t *testing.T) {
...
@@ -2824,7 +2824,7 @@ func TestInterPodAffinityWithMultipleNodes(t *testing.T) {
},
},
{
{
pod
:
&
v1
.
Pod
{
pod
:
&
v1
.
Pod
{
ObjectMeta
:
v1
.
ObjectMeta
{
Labels
:
map
[
string
]
string
{
"foo"
:
"123"
}},
ObjectMeta
:
meta
v1
.
ObjectMeta
{
Labels
:
map
[
string
]
string
{
"foo"
:
"123"
}},
Spec
:
v1
.
PodSpec
{
Spec
:
v1
.
PodSpec
{
Affinity
:
&
v1
.
Affinity
{
Affinity
:
&
v1
.
Affinity
{
PodAntiAffinity
:
&
v1
.
PodAntiAffinity
{
PodAntiAffinity
:
&
v1
.
PodAntiAffinity
{
...
@@ -2847,7 +2847,7 @@ func TestInterPodAffinityWithMultipleNodes(t *testing.T) {
...
@@ -2847,7 +2847,7 @@ func TestInterPodAffinityWithMultipleNodes(t *testing.T) {
},
},
},
},
pods
:
[]
*
v1
.
Pod
{
pods
:
[]
*
v1
.
Pod
{
{
Spec
:
v1
.
PodSpec
{
NodeName
:
"nodeA"
},
ObjectMeta
:
v1
.
ObjectMeta
{
Labels
:
map
[
string
]
string
{
"foo"
:
"bar"
}}},
{
Spec
:
v1
.
PodSpec
{
NodeName
:
"nodeA"
},
ObjectMeta
:
meta
v1
.
ObjectMeta
{
Labels
:
map
[
string
]
string
{
"foo"
:
"bar"
}}},
{
{
Spec
:
v1
.
PodSpec
{
Spec
:
v1
.
PodSpec
{
NodeName
:
"nodeC"
,
NodeName
:
"nodeC"
,
...
@@ -2873,10 +2873,10 @@ func TestInterPodAffinityWithMultipleNodes(t *testing.T) {
...
@@ -2873,10 +2873,10 @@ func TestInterPodAffinityWithMultipleNodes(t *testing.T) {
},
},
},
},
nodes
:
[]
v1
.
Node
{
nodes
:
[]
v1
.
Node
{
{
ObjectMeta
:
v1
.
ObjectMeta
{
Name
:
"nodeA"
,
Labels
:
labelRgChina
}},
{
ObjectMeta
:
meta
v1
.
ObjectMeta
{
Name
:
"nodeA"
,
Labels
:
labelRgChina
}},
{
ObjectMeta
:
v1
.
ObjectMeta
{
Name
:
"nodeB"
,
Labels
:
labelRgChinaAzAz1
}},
{
ObjectMeta
:
meta
v1
.
ObjectMeta
{
Name
:
"nodeB"
,
Labels
:
labelRgChinaAzAz1
}},
{
ObjectMeta
:
v1
.
ObjectMeta
{
Name
:
"nodeC"
,
Labels
:
labelRgIndia
}},
{
ObjectMeta
:
meta
v1
.
ObjectMeta
{
Name
:
"nodeC"
,
Labels
:
labelRgIndia
}},
{
ObjectMeta
:
v1
.
ObjectMeta
{
Name
:
"nodeD"
,
Labels
:
labelRgUS
}},
{
ObjectMeta
:
meta
v1
.
ObjectMeta
{
Name
:
"nodeD"
,
Labels
:
labelRgUS
}},
},
},
fits
:
map
[
string
]
bool
{
fits
:
map
[
string
]
bool
{
"nodeA"
:
false
,
"nodeA"
:
false
,
...
@@ -3214,7 +3214,7 @@ func TestPodToleratesTaints(t *testing.T) {
...
@@ -3214,7 +3214,7 @@ func TestPodToleratesTaints(t *testing.T) {
},
},
{
{
pod
:
&
v1
.
Pod
{
pod
:
&
v1
.
Pod
{
ObjectMeta
:
v1
.
ObjectMeta
{
ObjectMeta
:
meta
v1
.
ObjectMeta
{
Name
:
"pod2"
,
Name
:
"pod2"
,
},
},
Spec
:
v1
.
PodSpec
{
Spec
:
v1
.
PodSpec
{
...
@@ -3222,7 +3222,7 @@ func TestPodToleratesTaints(t *testing.T) {
...
@@ -3222,7 +3222,7 @@ func TestPodToleratesTaints(t *testing.T) {
},
},
},
},
node
:
v1
.
Node
{
node
:
v1
.
Node
{
ObjectMeta
:
v1
.
ObjectMeta
{
ObjectMeta
:
meta
v1
.
ObjectMeta
{
Annotations
:
map
[
string
]
string
{
Annotations
:
map
[
string
]
string
{
v1
.
TaintsAnnotationKey
:
`
v1
.
TaintsAnnotationKey
:
`
[{
[{
...
...
staging/src/k8s.io/apiserver/pkg/storage/names/generate_test.go
View file @
bcde0575
...
@@ -21,59 +21,9 @@ import (
...
@@ -21,59 +21,9 @@ import (
"testing"
"testing"
)
)
type
nameGeneratorFunc
func
(
base
string
)
string
func
(
fn
nameGeneratorFunc
)
GenerateName
(
base
string
)
string
{
return
fn
(
base
)
}
func
TestGenerateName
(
t
*
testing
.
T
)
{
testCases
:=
[]
struct
{
meta
ObjectMeta
base
string
returned
string
}{
{
returned
:
""
,
},
{
meta
:
ObjectMeta
{
GenerateName
:
"test"
,
},
base
:
"test"
,
returned
:
"test"
,
},
{
meta
:
ObjectMeta
{
Name
:
"foo"
,
GenerateName
:
"test"
,
},
base
:
"test"
,
returned
:
"foo"
,
},
}
for
i
,
testCase
:=
range
testCases
{
GenerateName
(
nameGeneratorFunc
(
func
(
base
string
)
string
{
if
base
!=
testCase
.
base
{
t
.
Errorf
(
"%d: unexpected call with base"
,
i
)
}
return
"test"
}),
&
testCase
.
meta
)
expect
:=
testCase
.
returned
if
expect
!=
testCase
.
meta
.
Name
{
t
.
Errorf
(
"%d: unexpected name: %#v"
,
i
,
testCase
.
meta
)
}
}
}
func
TestSimpleNameGenerator
(
t
*
testing
.
T
)
{
func
TestSimpleNameGenerator
(
t
*
testing
.
T
)
{
meta
:=
&
metav1
.
ObjectMeta
{
name
:=
SimpleNameGenerator
.
GenerateName
(
"foo"
)
GenerateName
:
"foo"
,
if
!
strings
.
HasPrefix
(
name
,
"foo"
)
||
name
==
"foo"
{
}
t
.
Errorf
(
"unexpected name: %s"
,
name
)
metav1
.
GenerateName
(
SimpleNameGenerator
,
meta
)
if
!
strings
.
HasPrefix
(
meta
.
Name
,
"foo"
)
||
meta
.
Name
==
"foo"
{
t
.
Errorf
(
"unexpected name: %#v"
,
meta
)
}
}
}
}
staging/src/k8s.io/apiserver/pkg/webhook/webhook.go
View file @
bcde0575
...
@@ -21,12 +21,12 @@ import (
...
@@ -21,12 +21,12 @@ import (
"fmt"
"fmt"
"time"
"time"
apierrors
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/runtime/schema"
runtimeserializer
"k8s.io/apimachinery/pkg/runtime/serializer"
runtimeserializer
"k8s.io/apimachinery/pkg/runtime/serializer"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/client-go/pkg/api"
"k8s.io/client-go/pkg/api"
apierrors
"k8s.io/client-go/pkg/api/errors"
"k8s.io/client-go/rest"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
"k8s.io/client-go/tools/clientcmd"
...
...
test/soak/cauldron/cauldron.go
View file @
bcde0575
...
@@ -31,7 +31,7 @@ import (
...
@@ -31,7 +31,7 @@ import (
"github.com/golang/glog"
"github.com/golang/glog"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/errors"
v1
"k8s.io/apimachinery/pkg/apis/meta/v1"
meta
v1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api"
clientset
"k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
clientset
"k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
"k8s.io/kubernetes/pkg/client/restclient"
"k8s.io/kubernetes/pkg/client/restclient"
...
@@ -106,7 +106,7 @@ func main() {
...
@@ -106,7 +106,7 @@ func main() {
}
else
{
}
else
{
// wait until the namespace disappears
// wait until the namespace disappears
for
i
:=
0
;
i
<
int
(
namespaceDeleteTimeout
/
time
.
Second
);
i
++
{
for
i
:=
0
;
i
<
int
(
namespaceDeleteTimeout
/
time
.
Second
);
i
++
{
if
_
,
err
:=
client
.
Core
()
.
Namespaces
()
.
Get
(
ns
,
v1
.
GetOptions
{});
err
!=
nil
{
if
_
,
err
:=
client
.
Core
()
.
Namespaces
()
.
Get
(
ns
,
meta
v1
.
GetOptions
{});
err
!=
nil
{
if
errors
.
IsNotFound
(
err
)
{
if
errors
.
IsNotFound
(
err
)
{
return
return
}
}
...
@@ -221,7 +221,7 @@ func main() {
...
@@ -221,7 +221,7 @@ func main() {
for
_
,
podName
:=
range
podNames
{
for
_
,
podName
:=
range
podNames
{
var
pod
*
api
.
Pod
var
pod
*
api
.
Pod
for
start
:=
time
.
Now
();
time
.
Since
(
start
)
<
podStartTimeout
;
time
.
Sleep
(
5
*
time
.
Second
)
{
for
start
:=
time
.
Now
();
time
.
Since
(
start
)
<
podStartTimeout
;
time
.
Sleep
(
5
*
time
.
Second
)
{
pod
,
err
=
client
.
Core
()
.
Pods
(
ns
)
.
Get
(
podName
,
v1
.
GetOptions
{})
pod
,
err
=
client
.
Core
()
.
Pods
(
ns
)
.
Get
(
podName
,
meta
v1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Warningf
(
"Get pod %s/%s failed, ignoring for %v: %v"
,
ns
,
podName
,
err
,
podStartTimeout
)
glog
.
Warningf
(
"Get pod %s/%s failed, ignoring for %v: %v"
,
ns
,
podName
,
err
,
podStartTimeout
)
continue
continue
...
...
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