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
8a590004
Commit
8a590004
authored
Nov 06, 2014
by
Clayton Coleman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Warn if pod has no labels
parent
d97f6cd0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
client_test.go
pkg/client/client_test.go
+2
-2
replication_controller.go
pkg/controller/replication_controller.go
+4
-0
No files found.
pkg/client/client_test.go
View file @
8a590004
...
@@ -89,7 +89,7 @@ func (c *testClient) Validate(t *testing.T, received runtime.Object, err error)
...
@@ -89,7 +89,7 @@ func (c *testClient) Validate(t *testing.T, received runtime.Object, err error)
c
.
ValidateCommon
(
t
,
err
)
c
.
ValidateCommon
(
t
,
err
)
if
c
.
Response
.
Body
!=
nil
&&
!
reflect
.
DeepEqual
(
c
.
Response
.
Body
,
received
)
{
if
c
.
Response
.
Body
!=
nil
&&
!
reflect
.
DeepEqual
(
c
.
Response
.
Body
,
received
)
{
t
.
Errorf
(
"bad response for request %#v: expected %
s, got %s
"
,
c
.
Request
,
c
.
Response
.
Body
,
received
)
t
.
Errorf
(
"bad response for request %#v: expected %
#v, got %#v
"
,
c
.
Request
,
c
.
Response
.
Body
,
received
)
}
}
}
}
...
@@ -97,7 +97,7 @@ func (c *testClient) ValidateRaw(t *testing.T, received []byte, err error) {
...
@@ -97,7 +97,7 @@ func (c *testClient) ValidateRaw(t *testing.T, received []byte, err error) {
c
.
ValidateCommon
(
t
,
err
)
c
.
ValidateCommon
(
t
,
err
)
if
c
.
Response
.
Body
!=
nil
&&
!
reflect
.
DeepEqual
(
c
.
Response
.
Body
,
received
)
{
if
c
.
Response
.
Body
!=
nil
&&
!
reflect
.
DeepEqual
(
c
.
Response
.
Body
,
received
)
{
t
.
Errorf
(
"bad response for request %#v: expected %
s, got %s
"
,
c
.
Request
,
c
.
Response
.
Body
,
received
)
t
.
Errorf
(
"bad response for request %#v: expected %
#v, got %#v
"
,
c
.
Request
,
c
.
Response
.
Body
,
received
)
}
}
}
}
...
...
pkg/controller/replication_controller.go
View file @
8a590004
...
@@ -66,6 +66,10 @@ func (r RealPodControl) createReplica(namespace string, controller api.Replicati
...
@@ -66,6 +66,10 @@ func (r RealPodControl) createReplica(namespace string, controller api.Replicati
glog
.
Errorf
(
"Unable to convert pod template: %v"
,
err
)
glog
.
Errorf
(
"Unable to convert pod template: %v"
,
err
)
return
return
}
}
if
labels
.
Set
(
pod
.
Labels
)
.
AsSelector
()
.
Empty
()
{
glog
.
Errorf
(
"Unable to create pod replica, no labels"
)
return
}
if
_
,
err
:=
r
.
kubeClient
.
Pods
(
namespace
)
.
Create
(
pod
);
err
!=
nil
{
if
_
,
err
:=
r
.
kubeClient
.
Pods
(
namespace
)
.
Create
(
pod
);
err
!=
nil
{
glog
.
Errorf
(
"Unable to create pod replica: %v"
,
err
)
glog
.
Errorf
(
"Unable to create pod replica: %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