Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pkg/deploy/controller/configchange/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

kapi "github.com/GoogleCloudPlatform/kubernetes/pkg/api"
kerrors "github.com/GoogleCloudPlatform/kubernetes/pkg/api/errors"
"github.com/GoogleCloudPlatform/kubernetes/pkg/client/record"

deployapi "github.com/openshift/origin/pkg/deploy/api"
deployutil "github.com/openshift/origin/pkg/deploy/util"
Expand All @@ -22,6 +23,8 @@ type DeploymentConfigChangeController struct {
changeStrategy changeStrategy
// decodeConfig knows how to decode the deploymentConfig from a deployment's annotations.
decodeConfig func(deployment *kapi.ReplicationController) (*deployapi.DeploymentConfig, error)
// recorder records events.
recorder record.EventRecorder
}

// fatalError is an error which can't be retried.
Expand Down Expand Up @@ -52,6 +55,7 @@ func (c *DeploymentConfigChangeController) Handle(config *deployapi.DeploymentCo
if kerrors.IsConflict(err) {
return fatalError(fmt.Sprintf("DeploymentConfig %s updated since retrieval; aborting trigger: %v", deployutil.LabelForDeploymentConfig(config), err))
}
c.recorder.Eventf(config, "failedCreate", "Couldn't create initial deployment: %v", err)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this going to record an event over and over and over?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every second for 3 days?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not at the moment. It'll only happen when more DC events roll in. The reflector for this controller only resyncs every few minutes. The configChange controller currently only retries once until #3051 is resolved (at which point this should be rate limited/time based).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to be 100% sure, I've verified this manually (letting my initial deployment rot, I got 2 events up front from the retry and another couple a few minutes later- both treated as dupes by k8s; the "count" increases for a single event).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

K

----- Original Message -----

@@ -52,6 +55,7 @@ func (c *DeploymentConfigChangeController) Handle(config
*deployapi.DeploymentCo
if kerrors.IsConflict(err) {
return fatalError(fmt.Sprintf("DeploymentConfig %s updated since
retrieval; aborting trigger: %v",
deployutil.LabelForDeploymentConfig(config), err))
}

  •       c.recorder.Eventf(config, "failedCreate", "Couldn't create initial
    
    deployment: %v", err)

Just to be 100% sure, I've verified this manually (letting my initial
deployment rot, I got 2 events up front from the retry and another couple a
few minutes later- both treated as dupes by k8s; the "count" increases for a
single event).


Reply to this email directly or view it on GitHub:
https://github.com/openshift/origin/pull/3106/files#r32251088

return fmt.Errorf("couldn't create initial Deployment for DeploymentConfig %s: %v", deployutil.LabelForDeploymentConfig(config), err)
}
glog.V(4).Infof("Created initial Deployment for DeploymentConfig %s", deployutil.LabelForDeploymentConfig(config))
Expand Down
5 changes: 5 additions & 0 deletions pkg/deploy/controller/configchange/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
kapi "github.com/GoogleCloudPlatform/kubernetes/pkg/api"
kclient "github.com/GoogleCloudPlatform/kubernetes/pkg/client"
"github.com/GoogleCloudPlatform/kubernetes/pkg/client/cache"
"github.com/GoogleCloudPlatform/kubernetes/pkg/client/record"
"github.com/GoogleCloudPlatform/kubernetes/pkg/fields"
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
"github.com/GoogleCloudPlatform/kubernetes/pkg/runtime"
Expand Down Expand Up @@ -42,6 +43,9 @@ func (factory *DeploymentConfigChangeControllerFactory) Create() controller.Runn
queue := cache.NewFIFO(cache.MetaNamespaceKeyFunc)
cache.NewReflector(deploymentConfigLW, &deployapi.DeploymentConfig{}, queue, 2*time.Minute).Run()

eventBroadcaster := record.NewBroadcaster()
eventBroadcaster.StartRecordingToSink(factory.KubeClient.Events(""))

changeController := &DeploymentConfigChangeController{
changeStrategy: &changeStrategyImpl{
getDeploymentFunc: func(namespace, name string) (*kapi.ReplicationController, error) {
Expand All @@ -57,6 +61,7 @@ func (factory *DeploymentConfigChangeControllerFactory) Create() controller.Runn
decodeConfig: func(deployment *kapi.ReplicationController) (*deployapi.DeploymentConfig, error) {
return deployutil.DecodeDeploymentConfig(deployment, factory.Codec)
},
recorder: eventBroadcaster.NewRecorder(kapi.EventSource{Component: "deployer"}),
}

return &controller.RetryController{
Expand Down