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
a2c29d48
Commit
a2c29d48
authored
Apr 13, 2015
by
nikhiljindal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removing references to v1beta1 from hack/ and test/
parent
86d30724
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
86 additions
and
64 deletions
+86
-64
services.sh
hack/e2e-suite/services.sh
+57
-45
test-cmd.sh
hack/test-cmd.sh
+18
-11
cadvisor.go
test/e2e/cadvisor.go
+1
-1
empty_dir.go
test/e2e/empty_dir.go
+2
-1
kubectl.go
test/e2e/kubectl.go
+1
-1
monitoring.go
test/e2e/monitoring.go
+1
-1
pd.go
test/e2e/pd.go
+2
-1
service.go
test/e2e/service.go
+4
-3
No files found.
hack/e2e-suite/services.sh
View file @
a2c29d48
...
...
@@ -73,40 +73,44 @@ function start_service() {
echo
"Starting service '
$1
' on port
$2
with
$3
replicas"
svcs_to_clean+
=(
"
$1
"
)
${
KUBECTL
}
create
-f
-
<<
__EOF__
{
"kind": "ReplicationController",
"apiVersion": "v1beta1",
"id": "
$1
",
"namespace": "default",
"desiredState": {
"replicas":
$3
,
"replicaSelector": {
"name": "
$1
"
},
"podTemplate": {
"desiredState": {
"manifest": {
"version": "v1beta2",
"containers": [
{
"name": "
$1
",
"image": "gcr.io/google_containers/serve_hostname:1.1",
"ports": [
{
"containerPort": 9376,
"protocol": "TCP"
}
]
}
]
}
},
"labels": {
"name": "
$1
"
}
{
"kind": "ReplicationController",
"apiVersion": "v1beta3",
"metadata": {
"name": "
$1
",
"namespace": "default",
"labels": {
"name": "
$1
"
}
},
"spec": {
"replicas":
$3
,
"selector": {
"name": "
$1
"
},
"template": {
"metadata": {
"labels": {
"name": "
$1
"
}
},
"spec": {
"containers": [
{
"name": "
$1
",
"image": "gcr.io/google_containers/serve_hostname:1.1",
"ports": [
{
"containerPort": 9376,
"protocol": "TCP"
}
]
}
]
}
}
}
}
__EOF__
# Convert '1.2.3.4 5.6.7.8' => '"1.2.3.4", "5.6.7.8"'
local
ip
ips_array
=()
public_ips
...
...
@@ -115,22 +119,30 @@ __EOF__
done
public_ips
=
$(
join
", "
"
${
ips_array
[@]
:+
${
ips_array
[@]
}}
"
)
${
KUBECTL
}
create
-f
-
<<
__EOF__
{
"kind": "Service",
"apiVersion": "v1beta3",
"metadata": {
"name": "
$1
",
"namespace": "default",
"labels": {
"name": "
$1
"
}
},
"spec": {
"ports": [
{
"kind": "Service",
"apiVersion": "v1beta1",
"id": "
$1
",
"namespace": "default",
"port":
$2
,
"protocol": "TCP",
"labels": {
"name": "
$1
"
},
"selector": {
"name": "
$1
"
},
"containerPort": 9376,
"publicIPs": [
${
public_ips
}
]
"protocol": "TCP",
"port":
$2
,
"targetPort": 9376
}
],
"selector": {
"name": "
$1
"
},
"publicIPs": [
${
public_ips
}
]
}
}
__EOF__
}
...
...
hack/test-cmd.sh
View file @
a2c29d48
...
...
@@ -108,7 +108,7 @@ kube::log::status "Starting CONTROLLER-MANAGER"
CTLRMGR_PID
=
$!
kube::util::wait_for_url
"http://127.0.0.1:
${
CTLRMGR_PORT
}
/healthz"
"controller-manager: "
kube::util::wait_for_url
"http://127.0.0.1:
${
API_PORT
}
/api/v1beta
1/minions/127.0.0.1"
"apiserver(minion
s): "
0.2 25
kube::util::wait_for_url
"http://127.0.0.1:
${
API_PORT
}
/api/v1beta
3/nodes/127.0.0.1"
"apiserver(node
s): "
0.2 25
# Expose kubectl directly for readability
PATH
=
"
${
KUBE_OUTPUT_HOSTBIN
}
"
:
$PATH
...
...
@@ -170,7 +170,7 @@ for version in "${kube_api_versions[@]}"; do
kube::test::describe_object_assert pods
'valid-pod'
"Name:"
"Image(s):"
"Host:"
"Labels:"
"Status:"
"Replication Controllers"
### Dump current valid-pod POD
output_pod
=
$(
kubectl get pod valid-pod
-o
yaml
--output-version
=
v1beta
1
"
${
kube_flags
[@]
}
"
)
output_pod
=
$(
kubectl get pod valid-pod
-o
yaml
--output-version
=
v1beta
3
"
${
kube_flags
[@]
}
"
)
### Delete POD valid-pod by id
# Pre-condition: valid-pod POD is running
...
...
@@ -396,22 +396,29 @@ for version in "${kube_api_versions[@]}"; do
kube::test::get_object_assert services
"{{range.items}}{{
$id_field
}}:{{end}}"
'kubernetes:kubernetes-ro:redis-master:'
# Command
kubectl create
-f
-
"
${
kube_flags
[@]
}
"
<<
__EOF__
{
"kind": "Service",
"apiVersion": "v1beta3",
"metadata": {
"name": "service-
${
version
}
-test"
},
"spec": {
"ports": [
{
"kind": "Service",
"apiVersion": "v1beta1",
"id": "service-
${
version
}
-test",
"port": 80,
"protocol": "TCP"
"protocol": "TCP",
"port": 80,
"targetPort": 80
}
]
}
}
__EOF__
# Post-condition:redis-master-service service is running
kube::test::get_object_assert services
"{{range.items}}{{
$id_field
}}:{{end}}"
'kubernetes:kubernetes-ro:redis-master:service-.*-test:'
# Command
kubectl update service
"
${
kube_flags
[@]
}
"
service-
${
version
}
-test
--patch
=
"{
\"
selector
\"
:{
\"
my
\"
:
\"
test-label
\"
},
\"
apiVersion
\"
:
\"
v1beta1
\"
}"
# Post-condition: selector.version == ${version}
# This test works only in v1beta1 and v1beta2
# https://github.com/GoogleCloudPlatform/kubernetes/issues/4771
kubectl update service
"
${
kube_flags
[@]
}
"
service-
${
version
}
-test
--patch
=
"{
\"
spec
\"
:{
\"
selector
\"
:{
\"
my
\"
:
\"
test-label
\"
}},
\"
apiVersion
\"
:
\"
v1beta3
\"
}"
--api-version
=
v1beta3
# Post-condition: selector has "test-label" label.
kube::test::get_object_assert
"service service-
${
version
}
-test"
"{{range
$service_selector_field
}}{{.}}{{end}}"
"test-label"
### Identity
...
...
test/e2e/cadvisor.go
View file @
a2c29d48
...
...
@@ -58,7 +58,7 @@ func CheckCadvisorHealthOnAllNodes(c *client.Client, timeout time.Duration) {
for
_
,
node
:=
range
nodeList
.
Items
{
// cadvisor is not accessible directly unless its port (4194 by default) is exposed.
// Here, we access '/stats/' REST endpoint on the kubelet which polls cadvisor internally.
statsResource
:=
fmt
.
Sprintf
(
"api/v1beta
1/proxy/minion
s/%s/stats/"
,
node
.
Name
)
statsResource
:=
fmt
.
Sprintf
(
"api/v1beta
3/proxy/node
s/%s/stats/"
,
node
.
Name
)
By
(
fmt
.
Sprintf
(
"Querying stats from node %s using url %s"
,
node
.
Name
,
statsResource
))
_
,
err
=
c
.
Get
()
.
AbsPath
(
statsResource
)
.
Timeout
(
timeout
)
.
Do
()
.
Raw
()
if
err
!=
nil
{
...
...
test/e2e/empty_dir.go
View file @
a2c29d48
...
...
@@ -21,6 +21,7 @@ import (
"path"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/latest"
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
...
...
@@ -88,7 +89,7 @@ func testPodWithVolume(path string, source *api.EmptyDirVolumeSource) *api.Pod {
return
&
api
.
Pod
{
TypeMeta
:
api
.
TypeMeta
{
Kind
:
"Pod"
,
APIVersion
:
"v1beta1"
,
APIVersion
:
latest
.
Version
,
},
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
podName
,
...
...
test/e2e/kubectl.go
View file @
a2c29d48
...
...
@@ -54,7 +54,7 @@ var _ = Describe("kubectl", func() {
Describe
(
"update-demo"
,
func
()
{
var
(
updateDemoRoot
=
filepath
.
Join
(
testContext
.
RepoRoot
,
"examples/update-demo/v1beta
1
"
)
updateDemoRoot
=
filepath
.
Join
(
testContext
.
RepoRoot
,
"examples/update-demo/v1beta
3
"
)
nautilusPath
=
filepath
.
Join
(
updateDemoRoot
,
"nautilus-rc.yaml"
)
kittenPath
=
filepath
.
Join
(
updateDemoRoot
,
"kitten-rc.yaml"
)
)
...
...
test/e2e/monitoring.go
View file @
a2c29d48
...
...
@@ -209,7 +209,7 @@ func testMonitoringUsingHeapsterInfluxdb(c *client.Client) {
if
!
ok
{
Failf
(
"failed to get master http client"
)
}
proxyUrl
:=
fmt
.
Sprintf
(
"%s/api/v1beta
1/proxy
/services/%s/"
,
getMasterHost
(),
influxdbService
)
proxyUrl
:=
fmt
.
Sprintf
(
"%s/api/v1beta
3/proxy/namespaces/default
/services/%s/"
,
getMasterHost
(),
influxdbService
)
config
:=
&
influxdb
.
ClientConfig
{
Host
:
proxyUrl
,
// TODO(vishh): Infer username and pw from the Pod spec.
...
...
test/e2e/pd.go
View file @
a2c29d48
...
...
@@ -23,6 +23,7 @@ import (
"time"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/latest"
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
"github.com/GoogleCloudPlatform/kubernetes/pkg/cloudprovider/aws"
"github.com/GoogleCloudPlatform/kubernetes/pkg/fields"
...
...
@@ -234,7 +235,7 @@ func testPDPod(diskName, targetHost string, readOnly bool) *api.Pod {
pod
:=
&
api
.
Pod
{
TypeMeta
:
api
.
TypeMeta
{
Kind
:
"Pod"
,
APIVersion
:
"v1beta1"
,
APIVersion
:
latest
.
Version
,
},
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"pd-test-"
+
string
(
util
.
NewUUID
()),
...
...
test/e2e/service.go
View file @
a2c29d48
...
...
@@ -25,6 +25,7 @@ import (
"time"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/latest"
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
...
...
@@ -74,7 +75,7 @@ var _ = Describe("Services", func() {
pod
:=
&
api
.
Pod
{
TypeMeta
:
api
.
TypeMeta
{
Kind
:
"Pod"
,
APIVersion
:
"v1beta1"
,
APIVersion
:
latest
.
Version
,
},
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"dns-test-"
+
string
(
util
.
NewUUID
()),
...
...
@@ -166,7 +167,7 @@ var _ = Describe("Services", func() {
It
(
"should provide RW and RO services"
,
func
()
{
svc
:=
api
.
ServiceList
{}
err
:=
c
.
Get
()
.
AbsPath
(
"/api/v1beta
1/proxy/services/kubernetes-ro/api/v1beta1
/services"
)
.
AbsPath
(
"/api/v1beta
3/proxy/namespaces/default/services/kubernetes-ro/api/v1beta3
/services"
)
.
Do
()
.
Into
(
&
svc
)
if
err
!=
nil
{
...
...
@@ -295,7 +296,7 @@ var _ = Describe("Services", func() {
pod
:=
&
api
.
Pod
{
TypeMeta
:
api
.
TypeMeta
{
Kind
:
"Pod"
,
APIVersion
:
"v1beta1"
,
APIVersion
:
latest
.
Version
,
},
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"elb-test-"
+
string
(
util
.
NewUUID
()),
...
...
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