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
078e85cf
Commit
078e85cf
authored
Jun 19, 2015
by
Satnam Singh
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #10076 from caesarxuchao/pr/9966/head
based on #9966: fix annoying 'please check...' messages; remove v1beta1&2 ref
parents
e5a2e331
5673f733
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
56 additions
and
38 deletions
+56
-38
conversion.go
pkg/api/v1/conversion.go
+1
-1
conversion.go
pkg/api/v1beta3/conversion.go
+3
-2
request.go
pkg/client/request.go
+48
-31
etcd_test.go
pkg/registry/pod/etcd/etcd_test.go
+3
-3
rest.go
pkg/registry/pod/rest.go
+1
-1
No files found.
pkg/api/v1/conversion.go
View file @
078e85cf
...
...
@@ -42,7 +42,7 @@ func addConversionFuncs() {
case
"metadata.name"
,
"metadata.namespace"
,
"status.phase"
,
"spec.
host
"
:
"spec.
nodeName
"
:
return
label
,
value
,
nil
default
:
return
""
,
""
,
fmt
.
Errorf
(
"field label not supported: %s"
,
label
)
...
...
pkg/api/v1beta3/conversion.go
View file @
078e85cf
...
...
@@ -53,9 +53,10 @@ func addConversionFuncs() {
switch
label
{
case
"metadata.name"
,
"metadata.namespace"
,
"status.phase"
,
"spec.host"
:
"status.phase"
:
return
label
,
value
,
nil
case
"spec.host"
:
return
"spec.nodeName"
,
value
,
nil
default
:
return
""
,
""
,
fmt
.
Errorf
(
"field label not supported: %s"
,
label
)
}
...
...
pkg/client/request.go
View file @
078e85cf
...
...
@@ -260,8 +260,18 @@ const (
// Will be automatically emitted as the correct name for the API version.
NodeUnschedulable
=
"spec.unschedulable"
ObjectNameField
=
"metadata.name"
PodHost
=
"spec.
host
"
PodHost
=
"spec.
nodeName
"
SecretType
=
"type"
EventReason
=
"reason"
EventSource
=
"source"
EventInvolvedKind
=
"involvedObject.kind"
EventInvolvedNamespace
=
"involvedObject.namespace"
EventInvolvedName
=
"involvedObject.name"
EventInvolvedUID
=
"involvedObject.uid"
EventInvolvedAPIVersion
=
"involvedObject.apiVersion"
EventInvolvedResourceVersion
=
"involvedObject.resourceVersion"
EventInvolvedFieldPath
=
"involvedObject.fieldPath"
)
type
clientFieldNameToAPIVersionFieldName
map
[
string
]
string
...
...
@@ -302,55 +312,47 @@ func (v versionToResourceToFieldMapping) filterField(apiVersion, resourceType, f
}
var
fieldMappings
=
versionToResourceToFieldMapping
{
"v1beta
1
"
:
resourceTypeToFieldMapping
{
"v1beta
3
"
:
resourceTypeToFieldMapping
{
"nodes"
:
clientFieldNameToAPIVersionFieldName
{
ObjectNameField
:
"name"
,
NodeUnschedulable
:
"unschedulable"
,
ObjectNameField
:
"
metadata.
name"
,
NodeUnschedulable
:
"
spec.
unschedulable"
,
},
"minions"
:
clientFieldNameToAPIVersionFieldName
{
ObjectNameField
:
"name"
,
NodeUnschedulable
:
"unschedulable"
,
ObjectNameField
:
"
metadata.
name"
,
NodeUnschedulable
:
"
spec.
unschedulable"
,
},
"pods"
:
clientFieldNameToAPIVersionFieldName
{
PodHost
:
"
DesiredState.H
ost"
,
PodHost
:
"
spec.h
ost"
,
},
"secrets"
:
clientFieldNameToAPIVersionFieldName
{
SecretType
:
"type"
,
},
"serviceAccounts"
:
clientFieldNameToAPIVersionFieldName
{
ObjectNameField
:
"name"
,
},
},
"v1beta2"
:
resourceTypeToFieldMapping
{
"nodes"
:
clientFieldNameToAPIVersionFieldName
{
ObjectNameField
:
"name"
,
NodeUnschedulable
:
"unschedulable"
,
},
"minions"
:
clientFieldNameToAPIVersionFieldName
{
ObjectNameField
:
"name"
,
NodeUnschedulable
:
"unschedulable"
,
},
"pods"
:
clientFieldNameToAPIVersionFieldName
{
PodHost
:
"DesiredState.Host"
,
ObjectNameField
:
"metadata.name"
,
},
"
secre
ts"
:
clientFieldNameToAPIVersionFieldName
{
SecretType
:
"typ
e"
,
"
endpoin
ts"
:
clientFieldNameToAPIVersionFieldName
{
ObjectNameField
:
"metadata.nam
e"
,
},
"serviceAccounts"
:
clientFieldNameToAPIVersionFieldName
{
ObjectNameField
:
"name"
,
"events"
:
clientFieldNameToAPIVersionFieldName
{
ObjectNameField
:
"metadata.name"
,
EventReason
:
"reason"
,
EventSource
:
"source"
,
EventInvolvedKind
:
"involvedObject.kind"
,
EventInvolvedNamespace
:
"involvedObject.namespace"
,
EventInvolvedName
:
"involvedObject.name"
,
EventInvolvedUID
:
"involvedObject.uid"
,
EventInvolvedAPIVersion
:
"involvedObject.apiVersion"
,
EventInvolvedResourceVersion
:
"involvedObject.resourceVersion"
,
EventInvolvedFieldPath
:
"involvedObject.fieldPath"
,
},
},
"v1
beta3
"
:
resourceTypeToFieldMapping
{
"v1"
:
resourceTypeToFieldMapping
{
"nodes"
:
clientFieldNameToAPIVersionFieldName
{
ObjectNameField
:
"metadata.name"
,
NodeUnschedulable
:
"spec.unschedulable"
,
},
"minions"
:
clientFieldNameToAPIVersionFieldName
{
ObjectNameField
:
"metadata.name"
,
NodeUnschedulable
:
"spec.unschedulable"
,
},
"pods"
:
clientFieldNameToAPIVersionFieldName
{
PodHost
:
"spec.
host
"
,
PodHost
:
"spec.
nodeName
"
,
},
"secrets"
:
clientFieldNameToAPIVersionFieldName
{
SecretType
:
"type"
,
...
...
@@ -358,6 +360,21 @@ var fieldMappings = versionToResourceToFieldMapping{
"serviceAccounts"
:
clientFieldNameToAPIVersionFieldName
{
ObjectNameField
:
"metadata.name"
,
},
"endpoints"
:
clientFieldNameToAPIVersionFieldName
{
ObjectNameField
:
"metadata.name"
,
},
"events"
:
clientFieldNameToAPIVersionFieldName
{
ObjectNameField
:
"metadata.name"
,
EventReason
:
"reason"
,
EventSource
:
"source"
,
EventInvolvedKind
:
"involvedObject.kind"
,
EventInvolvedNamespace
:
"involvedObject.namespace"
,
EventInvolvedName
:
"involvedObject.name"
,
EventInvolvedUID
:
"involvedObject.uid"
,
EventInvolvedAPIVersion
:
"involvedObject.apiVersion"
,
EventInvolvedResourceVersion
:
"involvedObject.resourceVersion"
,
EventInvolvedFieldPath
:
"involvedObject.fieldPath"
,
},
},
}
...
...
pkg/registry/pod/etcd/etcd_test.go
View file @
078e85cf
...
...
@@ -323,13 +323,13 @@ func TestListPodListSelection(t *testing.T) {
field
:
"status.phase=Failed"
,
expectedIDs
:
util
.
NewStringSet
(
"baz"
),
},
{
field
:
"spec.
host
=barhost"
,
field
:
"spec.
nodeName
=barhost"
,
expectedIDs
:
util
.
NewStringSet
(
"bar"
),
},
{
field
:
"spec.
host
="
,
field
:
"spec.
nodeName
="
,
expectedIDs
:
util
.
NewStringSet
(
"foo"
,
"baz"
,
"qux"
,
"zot"
),
},
{
field
:
"spec.
host
!="
,
field
:
"spec.
nodeName
!="
,
expectedIDs
:
util
.
NewStringSet
(
"bar"
),
},
}
...
...
pkg/registry/pod/rest.go
View file @
078e85cf
...
...
@@ -123,7 +123,7 @@ func MatchPod(label labels.Selector, field fields.Selector) generic.Matcher {
func
PodToSelectableFields
(
pod
*
api
.
Pod
)
fields
.
Set
{
return
fields
.
Set
{
"metadata.name"
:
pod
.
Name
,
"spec.
host"
:
pod
.
Spec
.
NodeName
,
"spec.
nodeName"
:
pod
.
Spec
.
NodeName
,
"status.phase"
:
string
(
pod
.
Status
.
Phase
),
}
}
...
...
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