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
986c2253
Commit
986c2253
authored
Apr 14, 2015
by
derekwaynecarr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replication controller gives failedCreate events
parent
88cf777d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
replication_controller.go
pkg/controller/replication_controller.go
+8
-0
No files found.
pkg/controller/replication_controller.go
View file @
986c2253
...
@@ -25,6 +25,7 @@ import (
...
@@ -25,6 +25,7 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/errors"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/errors"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/validation"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/validation"
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
"github.com/GoogleCloudPlatform/kubernetes/pkg/client/record"
"github.com/GoogleCloudPlatform/kubernetes/pkg/fields"
"github.com/GoogleCloudPlatform/kubernetes/pkg/fields"
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
...
@@ -55,6 +56,7 @@ type PodControlInterface interface {
...
@@ -55,6 +56,7 @@ type PodControlInterface interface {
// RealPodControl is the default implementation of PodControllerInterface.
// RealPodControl is the default implementation of PodControllerInterface.
type
RealPodControl
struct
{
type
RealPodControl
struct
{
kubeClient
client
.
Interface
kubeClient
client
.
Interface
recorder
record
.
EventRecorder
}
}
// Time period of main replication controller sync loop
// Time period of main replication controller sync loop
...
@@ -92,6 +94,7 @@ func (r RealPodControl) createReplica(namespace string, controller api.Replicati
...
@@ -92,6 +94,7 @@ func (r RealPodControl) createReplica(namespace string, controller api.Replicati
return
return
}
}
if
_
,
err
:=
r
.
kubeClient
.
Pods
(
namespace
)
.
Create
(
pod
);
err
!=
nil
{
if
_
,
err
:=
r
.
kubeClient
.
Pods
(
namespace
)
.
Create
(
pod
);
err
!=
nil
{
r
.
recorder
.
Eventf
(
&
controller
,
"failedCreate"
,
"Error creating: %v"
,
err
)
util
.
HandleError
(
fmt
.
Errorf
(
"unable to create pod replica: %v"
,
err
))
util
.
HandleError
(
fmt
.
Errorf
(
"unable to create pod replica: %v"
,
err
))
}
}
}
}
...
@@ -102,12 +105,17 @@ func (r RealPodControl) deletePod(namespace, podID string) error {
...
@@ -102,12 +105,17 @@ func (r RealPodControl) deletePod(namespace, podID string) error {
// NewReplicationManager creates a new ReplicationManager.
// NewReplicationManager creates a new ReplicationManager.
func
NewReplicationManager
(
kubeClient
client
.
Interface
)
*
ReplicationManager
{
func
NewReplicationManager
(
kubeClient
client
.
Interface
)
*
ReplicationManager
{
eventBroadcaster
:=
record
.
NewBroadcaster
()
eventBroadcaster
.
StartRecordingToSink
(
kubeClient
.
Events
(
""
))
rm
:=
&
ReplicationManager
{
rm
:=
&
ReplicationManager
{
kubeClient
:
kubeClient
,
kubeClient
:
kubeClient
,
podControl
:
RealPodControl
{
podControl
:
RealPodControl
{
kubeClient
:
kubeClient
,
kubeClient
:
kubeClient
,
recorder
:
eventBroadcaster
.
NewRecorder
(
api
.
EventSource
{
Component
:
"replication-controller"
}),
},
},
}
}
rm
.
syncHandler
=
rm
.
syncReplicationController
rm
.
syncHandler
=
rm
.
syncReplicationController
return
rm
return
rm
}
}
...
...
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