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
7550c146
Commit
7550c146
authored
Oct 23, 2014
by
Clayton Coleman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace struct initializers for TypeMeta with ObjectMeta
parent
bc748fad
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
21 additions
and
19 deletions
+21
-19
operation.go
pkg/apiserver/operation.go
+1
-1
kubecfg.go
pkg/kubecfg/kubecfg.go
+7
-5
server.go
pkg/kubelet/server.go
+5
-5
master.go
pkg/master/master.go
+1
-1
etcd.go
pkg/proxy/config/etcd.go
+1
-1
rest.go
pkg/registry/minion/rest.go
+1
-1
minion.go
pkg/registry/registrytest/minion.go
+1
-1
endpoints_controller.go
pkg/service/endpoints_controller.go
+1
-1
scheduler.go
plugin/pkg/scheduler/scheduler.go
+3
-3
No files found.
pkg/apiserver/operation.go
View file @
7550c146
...
...
@@ -125,7 +125,7 @@ func (ops *Operations) List() *api.ServerOpList {
sort
.
StringSlice
(
ids
)
.
Sort
()
ol
:=
&
api
.
ServerOpList
{}
for
_
,
id
:=
range
ids
{
ol
.
Items
=
append
(
ol
.
Items
,
api
.
ServerOp
{
TypeMeta
:
api
.
Type
Meta
{
Name
:
id
}})
ol
.
Items
=
append
(
ol
.
Items
,
api
.
ServerOp
{
ObjectMeta
:
api
.
Object
Meta
{
Name
:
id
}})
}
return
ol
}
...
...
pkg/kubecfg/kubecfg.go
View file @
7550c146
...
...
@@ -245,7 +245,7 @@ func RunController(ctx api.Context, image, name string, replicas int, client cli
return
err
}
controller
:=
&
api
.
ReplicationController
{
TypeMeta
:
api
.
Type
Meta
{
ObjectMeta
:
api
.
Object
Meta
{
Name
:
name
,
},
DesiredState
:
api
.
ReplicationControllerState
{
...
...
@@ -299,11 +299,13 @@ func RunController(ctx api.Context, image, name string, replicas int, client cli
func
createService
(
ctx
api
.
Context
,
name
string
,
port
int
,
client
client
.
Interface
)
(
*
api
.
Service
,
error
)
{
svc
:=
&
api
.
Service
{
TypeMeta
:
api
.
TypeMeta
{
Name
:
name
},
Port
:
port
,
Labels
:
map
[
string
]
string
{
"simpleService"
:
name
,
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
name
,
Labels
:
map
[
string
]
string
{
"simpleService"
:
name
,
},
},
Port
:
port
,
Selector
:
map
[
string
]
string
{
"simpleService"
:
name
,
},
...
...
pkg/kubelet/server.go
View file @
7550c146
...
...
@@ -204,7 +204,7 @@ func (s *Server) handleContainerLogs(w http.ResponseWriter, req *http.Request) {
tail
:=
uriValues
.
Get
(
"tail"
)
podFullName
:=
GetPodFullName
(
&
api
.
BoundPod
{
TypeMeta
:
api
.
Type
Meta
{
ObjectMeta
:
api
.
Object
Meta
{
Name
:
podID
,
Namespace
:
podNamespace
,
Annotations
:
map
[
string
]
string
{
ConfigSourceAnnotationKey
:
"etcd"
},
...
...
@@ -248,7 +248,7 @@ func (s *Server) handlePodInfo(w http.ResponseWriter, req *http.Request) {
}
// TODO: backwards compatibility with existing API, needs API change
podFullName
:=
GetPodFullName
(
&
api
.
BoundPod
{
TypeMeta
:
api
.
Type
Meta
{
ObjectMeta
:
api
.
Object
Meta
{
Name
:
podID
,
Namespace
:
podNamespace
,
Annotations
:
map
[
string
]
string
{
ConfigSourceAnnotationKey
:
"etcd"
},
...
...
@@ -323,7 +323,7 @@ func (s *Server) handleRun(w http.ResponseWriter, req *http.Request) {
return
}
podFullName
:=
GetPodFullName
(
&
api
.
BoundPod
{
TypeMeta
:
api
.
Type
Meta
{
ObjectMeta
:
api
.
Object
Meta
{
Name
:
podID
,
Namespace
:
podNamespace
,
Annotations
:
map
[
string
]
string
{
ConfigSourceAnnotationKey
:
"etcd"
},
...
...
@@ -373,7 +373,7 @@ func (s *Server) serveStats(w http.ResponseWriter, req *http.Request) {
case
3
:
// Backward compatibility without uuid information
podFullName
:=
GetPodFullName
(
&
api
.
BoundPod
{
TypeMeta
:
api
.
Type
Meta
{
ObjectMeta
:
api
.
Object
Meta
{
Name
:
components
[
1
],
// TODO: I am broken
Namespace
:
api
.
NamespaceDefault
,
...
...
@@ -383,7 +383,7 @@ func (s *Server) serveStats(w http.ResponseWriter, req *http.Request) {
stats
,
err
=
s
.
host
.
GetContainerInfo
(
podFullName
,
""
,
components
[
2
],
&
query
)
case
4
:
podFullName
:=
GetPodFullName
(
&
api
.
BoundPod
{
TypeMeta
:
api
.
Type
Meta
{
ObjectMeta
:
api
.
Object
Meta
{
Name
:
components
[
1
],
// TODO: I am broken
Namespace
:
""
,
...
...
pkg/master/master.go
View file @
7550c146
...
...
@@ -125,7 +125,7 @@ func (m *Master) init(c *Config) {
}
else
{
for
_
,
minionID
:=
range
c
.
Minions
{
m
.
minionRegistry
.
CreateMinion
(
nil
,
&
api
.
Minion
{
TypeMeta
:
api
.
Type
Meta
{
Name
:
minionID
},
ObjectMeta
:
api
.
Object
Meta
{
Name
:
minionID
},
NodeResources
:
c
.
NodeResources
,
})
}
...
...
pkg/proxy/config/etcd.go
View file @
7550c146
...
...
@@ -243,7 +243,7 @@ func (s ConfigSourceEtcd) ProcessChange(response *etcd.Response) {
parts
:=
strings
.
Split
(
response
.
Node
.
Key
[
1
:
],
"/"
)
if
len
(
parts
)
==
4
{
glog
.
V
(
4
)
.
Infof
(
"Deleting service: %s"
,
parts
[
3
])
serviceUpdate
:=
ServiceUpdate
{
Op
:
REMOVE
,
Services
:
[]
api
.
Service
{{
TypeMeta
:
api
.
Type
Meta
{
Name
:
parts
[
3
]}}}}
serviceUpdate
:=
ServiceUpdate
{
Op
:
REMOVE
,
Services
:
[]
api
.
Service
{{
ObjectMeta
:
api
.
Object
Meta
{
Name
:
parts
[
3
]}}}}
s
.
serviceChannel
<-
serviceUpdate
return
}
...
...
pkg/registry/minion/rest.go
View file @
7550c146
...
...
@@ -106,7 +106,7 @@ func (rs *REST) Update(ctx api.Context, minion runtime.Object) (<-chan runtime.O
}
func
(
rs
*
REST
)
toApiMinion
(
name
string
)
*
api
.
Minion
{
return
&
api
.
Minion
{
TypeMeta
:
api
.
Type
Meta
{
Name
:
name
}}
return
&
api
.
Minion
{
ObjectMeta
:
api
.
Object
Meta
{
Name
:
name
}}
}
// ResourceLocation returns a URL to which one can send traffic for the specified minion.
...
...
pkg/registry/registrytest/minion.go
View file @
7550c146
...
...
@@ -77,7 +77,7 @@ func (r *MinionRegistry) DeleteMinion(ctx api.Context, minionID string) error {
var
newList
[]
api
.
Minion
for
_
,
node
:=
range
r
.
Minions
.
Items
{
if
node
.
Name
!=
minionID
{
newList
=
append
(
newList
,
api
.
Minion
{
TypeMeta
:
api
.
Type
Meta
{
Name
:
node
.
Name
}})
newList
=
append
(
newList
,
api
.
Minion
{
ObjectMeta
:
api
.
Object
Meta
{
Name
:
node
.
Name
}})
}
}
r
.
Minions
.
Items
=
newList
...
...
pkg/service/endpoints_controller.go
View file @
7550c146
...
...
@@ -76,7 +76,7 @@ func (e *EndpointController) SyncServiceEndpoints() error {
if
err
!=
nil
{
if
errors
.
IsNotFound
(
err
)
{
currentEndpoints
=
&
api
.
Endpoints
{
TypeMeta
:
api
.
Type
Meta
{
ObjectMeta
:
api
.
Object
Meta
{
Name
:
service
.
Name
,
},
}
...
...
plugin/pkg/scheduler/scheduler.go
View file @
7550c146
...
...
@@ -73,9 +73,9 @@ func (s *Scheduler) scheduleOne() {
return
}
b
:=
&
api
.
Binding
{
TypeMeta
:
api
.
Type
Meta
{
Namespace
:
pod
.
Namespace
},
PodID
:
pod
.
Name
,
Host
:
dest
,
ObjectMeta
:
api
.
Object
Meta
{
Namespace
:
pod
.
Namespace
},
PodID
:
pod
.
Name
,
Host
:
dest
,
}
if
err
:=
s
.
config
.
Binder
.
Bind
(
b
);
err
!=
nil
{
record
.
Eventf
(
pod
,
""
,
string
(
api
.
PodWaiting
),
"failedScheduling"
,
"Binding rejected: %v"
,
err
)
...
...
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