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
9f2f10d6
Commit
9f2f10d6
authored
Mar 12, 2015
by
Wojciech Tyczynski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make scheduler to watch PodSpec.Host instead Status.Host
parent
a3fd0a9f
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
12 additions
and
13 deletions
+12
-13
conversion.go
pkg/api/v1beta1/conversion.go
+1
-1
conversion.go
pkg/api/v1beta2/conversion.go
+1
-1
conversion.go
pkg/api/v1beta3/conversion.go
+1
-1
resthandler.go
pkg/apiserver/resthandler.go
+0
-1
listwatch_test.go
pkg/client/cache/listwatch_test.go
+1
-1
apiserver.go
pkg/kubelet/config/apiserver.go
+1
-1
etcd_test.go
pkg/registry/pod/etcd/etcd_test.go
+4
-4
rest.go
pkg/registry/pod/rest.go
+1
-1
factory.go
plugin/pkg/scheduler/factory/factory.go
+2
-2
No files found.
pkg/api/v1beta1/conversion.go
View file @
9f2f10d6
...
@@ -1384,7 +1384,7 @@ func init() {
...
@@ -1384,7 +1384,7 @@ func init() {
case
"name"
:
case
"name"
:
return
"name"
,
value
,
nil
return
"name"
,
value
,
nil
case
"DesiredState.Host"
:
case
"DesiredState.Host"
:
return
"s
tatus
.host"
,
value
,
nil
return
"s
pec
.host"
,
value
,
nil
case
"DesiredState.Status"
:
case
"DesiredState.Status"
:
podStatus
:=
PodStatus
(
value
)
podStatus
:=
PodStatus
(
value
)
var
internalValue
newer
.
PodPhase
var
internalValue
newer
.
PodPhase
...
...
pkg/api/v1beta2/conversion.go
View file @
9f2f10d6
...
@@ -1300,7 +1300,7 @@ func init() {
...
@@ -1300,7 +1300,7 @@ func init() {
case
"name"
:
case
"name"
:
return
"name"
,
value
,
nil
return
"name"
,
value
,
nil
case
"DesiredState.Host"
:
case
"DesiredState.Host"
:
return
"s
tatus
.host"
,
value
,
nil
return
"s
pec
.host"
,
value
,
nil
case
"DesiredState.Status"
:
case
"DesiredState.Status"
:
podStatus
:=
PodStatus
(
value
)
podStatus
:=
PodStatus
(
value
)
var
internalValue
newer
.
PodPhase
var
internalValue
newer
.
PodPhase
...
...
pkg/api/v1beta3/conversion.go
View file @
9f2f10d6
...
@@ -31,7 +31,7 @@ func init() {
...
@@ -31,7 +31,7 @@ func init() {
fallthrough
fallthrough
case
"status.phase"
:
case
"status.phase"
:
fallthrough
fallthrough
case
"s
tatus
.host"
:
case
"s
pec
.host"
:
return
label
,
value
,
nil
return
label
,
value
,
nil
default
:
default
:
return
""
,
""
,
fmt
.
Errorf
(
"field label not supported: %s"
,
label
)
return
""
,
""
,
fmt
.
Errorf
(
"field label not supported: %s"
,
label
)
...
...
pkg/apiserver/resthandler.go
View file @
9f2f10d6
...
@@ -194,7 +194,6 @@ func CreateResource(r RESTCreater, ctxFn ContextFunc, namer ScopeNamer, codec ru
...
@@ -194,7 +194,6 @@ func CreateResource(r RESTCreater, ctxFn ContextFunc, namer ScopeNamer, codec ru
func
PatchResource
(
r
RESTPatcher
,
ctxFn
ContextFunc
,
namer
ScopeNamer
,
codec
runtime
.
Codec
,
typer
runtime
.
ObjectTyper
,
resource
string
,
admit
admission
.
Interface
)
restful
.
RouteFunction
{
func
PatchResource
(
r
RESTPatcher
,
ctxFn
ContextFunc
,
namer
ScopeNamer
,
codec
runtime
.
Codec
,
typer
runtime
.
ObjectTyper
,
resource
string
,
admit
admission
.
Interface
)
restful
.
RouteFunction
{
return
func
(
req
*
restful
.
Request
,
res
*
restful
.
Response
)
{
return
func
(
req
*
restful
.
Request
,
res
*
restful
.
Response
)
{
w
:=
res
.
ResponseWriter
w
:=
res
.
ResponseWriter
glog
.
Infof
(
"hi"
)
// TODO: we either want to remove timeout or document it (if we document, move timeout out of this function and declare it in api_installer)
// TODO: we either want to remove timeout or document it (if we document, move timeout out of this function and declare it in api_installer)
timeout
:=
parseTimeout
(
req
.
Request
.
URL
.
Query
()
.
Get
(
"timeout"
))
timeout
:=
parseTimeout
(
req
.
Request
.
URL
.
Query
()
.
Get
(
"timeout"
))
...
...
pkg/client/cache/listwatch_test.go
View file @
9f2f10d6
...
@@ -53,7 +53,7 @@ func getHostFieldLabel() string {
...
@@ -53,7 +53,7 @@ func getHostFieldLabel() string {
case
"v1beta1"
,
"v1beta2"
:
case
"v1beta1"
,
"v1beta2"
:
return
"DesiredState.Host"
return
"DesiredState.Host"
default
:
default
:
return
"s
tatus
.host"
return
"s
pec
.host"
}
}
}
}
...
...
pkg/kubelet/config/apiserver.go
View file @
9f2f10d6
...
@@ -57,6 +57,6 @@ func getHostFieldLabel(apiVersion string) string {
...
@@ -57,6 +57,6 @@ func getHostFieldLabel(apiVersion string) string {
case
"v1beta1"
,
"v1beta2"
:
case
"v1beta1"
,
"v1beta2"
:
return
"DesiredState.Host"
return
"DesiredState.Host"
default
:
default
:
return
"s
tatus
.host"
return
"s
pec
.host"
}
}
}
}
pkg/registry/pod/etcd/etcd_test.go
View file @
9f2f10d6
...
@@ -300,7 +300,7 @@ func TestListPodListSelection(t *testing.T) {
...
@@ -300,7 +300,7 @@ func TestListPodListSelection(t *testing.T) {
})},
})},
{
Value
:
runtime
.
EncodeOrDie
(
latest
.
Codec
,
&
api
.
Pod
{
{
Value
:
runtime
.
EncodeOrDie
(
latest
.
Codec
,
&
api
.
Pod
{
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"bar"
},
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"bar"
},
S
tatus
:
api
.
PodStatus
{
Host
:
"barhost"
},
S
pec
:
api
.
PodSpec
{
Host
:
"barhost"
},
})},
})},
{
Value
:
runtime
.
EncodeOrDie
(
latest
.
Codec
,
&
api
.
Pod
{
{
Value
:
runtime
.
EncodeOrDie
(
latest
.
Codec
,
&
api
.
Pod
{
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"baz"
},
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"baz"
},
...
@@ -341,13 +341,13 @@ func TestListPodListSelection(t *testing.T) {
...
@@ -341,13 +341,13 @@ func TestListPodListSelection(t *testing.T) {
field
:
"status.phase=Failed"
,
field
:
"status.phase=Failed"
,
expectedIDs
:
util
.
NewStringSet
(
"baz"
),
expectedIDs
:
util
.
NewStringSet
(
"baz"
),
},
{
},
{
field
:
"s
tatus
.host=barhost"
,
field
:
"s
pec
.host=barhost"
,
expectedIDs
:
util
.
NewStringSet
(
"bar"
),
expectedIDs
:
util
.
NewStringSet
(
"bar"
),
},
{
},
{
field
:
"s
tatus
.host="
,
field
:
"s
pec
.host="
,
expectedIDs
:
util
.
NewStringSet
(
"foo"
,
"baz"
,
"qux"
,
"zot"
),
expectedIDs
:
util
.
NewStringSet
(
"foo"
,
"baz"
,
"qux"
,
"zot"
),
},
{
},
{
field
:
"s
tatus
.host!="
,
field
:
"s
pec
.host!="
,
expectedIDs
:
util
.
NewStringSet
(
"bar"
),
expectedIDs
:
util
.
NewStringSet
(
"bar"
),
},
},
}
}
...
...
pkg/registry/pod/rest.go
View file @
9f2f10d6
...
@@ -133,8 +133,8 @@ func MatchPod(label labels.Selector, field fields.Selector) generic.Matcher {
...
@@ -133,8 +133,8 @@ func MatchPod(label labels.Selector, field fields.Selector) generic.Matcher {
func
PodToSelectableFields
(
pod
*
api
.
Pod
)
labels
.
Set
{
func
PodToSelectableFields
(
pod
*
api
.
Pod
)
labels
.
Set
{
return
labels
.
Set
{
return
labels
.
Set
{
"name"
:
pod
.
Name
,
"name"
:
pod
.
Name
,
"spec.host"
:
pod
.
Spec
.
Host
,
"status.phase"
:
string
(
pod
.
Status
.
Phase
),
"status.phase"
:
string
(
pod
.
Status
.
Phase
),
"status.host"
:
pod
.
Status
.
Host
,
}
}
}
}
...
...
plugin/pkg/scheduler/factory/factory.go
View file @
9f2f10d6
...
@@ -154,7 +154,7 @@ func (f *ConfigFactory) CreateFromKeys(predicateKeys, priorityKeys util.StringSe
...
@@ -154,7 +154,7 @@ func (f *ConfigFactory) CreateFromKeys(predicateKeys, priorityKeys util.StringSe
Binder
:
&
binder
{
f
.
Client
},
Binder
:
&
binder
{
f
.
Client
},
NextPod
:
func
()
*
api
.
Pod
{
NextPod
:
func
()
*
api
.
Pod
{
pod
:=
f
.
PodQueue
.
Pop
()
.
(
*
api
.
Pod
)
pod
:=
f
.
PodQueue
.
Pop
()
.
(
*
api
.
Pod
)
glog
.
V
(
2
)
.
Infof
(
"
glog.v2 -->
About to try and schedule pod %v"
,
pod
.
Name
)
glog
.
V
(
2
)
.
Infof
(
"About to try and schedule pod %v"
,
pod
.
Name
)
return
pod
return
pod
},
},
Error
:
f
.
makeDefaultErrorFunc
(
&
podBackoff
,
f
.
PodQueue
),
Error
:
f
.
makeDefaultErrorFunc
(
&
podBackoff
,
f
.
PodQueue
),
...
@@ -259,7 +259,7 @@ func getHostFieldLabel(apiVersion string) string {
...
@@ -259,7 +259,7 @@ func getHostFieldLabel(apiVersion string) string {
case
"v1beta1"
,
"v1beta2"
:
case
"v1beta1"
,
"v1beta2"
:
return
"DesiredState.Host"
return
"DesiredState.Host"
default
:
default
:
return
"s
tatus
.host"
return
"s
pec
.host"
}
}
}
}
...
...
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