Skip to content

Commit

Permalink
clayton changes
Browse files Browse the repository at this point in the history
  • Loading branch information
bparees committed Sep 26, 2016
1 parent 67d556d commit f5a2cd8
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 13 deletions.
4 changes: 2 additions & 2 deletions pkg/build/controller/factory/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
const (
// We must avoid creating processing imagestream changes until the build config store has synced.
// If it hasn't synced, to avoid a hot loop, we'll wait this long between checks.
StoreSyncedPollPeriod = 100 * time.Millisecond
storeSyncedPollPeriod = 100 * time.Millisecond
maxRetries = 60
)

Expand Down Expand Up @@ -322,7 +322,7 @@ func (factory *ImageChangeControllerFactory) waitForSyncedStores() {
for !factory.BuildConfigIndexSynced() {
glog.V(4).Infof("Waiting for the bc caches to sync before starting the imagechange buildconfig controller worker")
select {
case <-time.After(StoreSyncedPollPeriod):
case <-time.After(storeSyncedPollPeriod):
case <-factory.Stop:
return
}
Expand Down
1 change: 1 addition & 0 deletions pkg/client/cache/buildconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func (s *StoreToBuildConfigListerImpl) BuildConfigs(namespace string) storeBuild
return storeBuildConfigsNamespacer{s.Indexer, namespace}
}

// storeBuildConfigsNamespacer provides a way to get and list BuildConfigs from a specific namespace.
type storeBuildConfigsNamespacer struct {
indexer cache.Indexer
namespace string
Expand Down
1 change: 1 addition & 0 deletions pkg/client/cache/deploymentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ func (s *StoreToDeploymentConfigLister) DeploymentConfigs(namespace string) stor
return storeDeploymentConfigsNamespacer{s.Indexer, namespace}
}

// storeDeploymentConfigsNamespacer provides a way to get and list DeploymentConfigs from a specific namespace.
type storeDeploymentConfigsNamespacer struct {
indexer cache.Indexer
namespace string
Expand Down
10 changes: 7 additions & 3 deletions pkg/client/cache/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ func ImageStreamReferenceIndexFunc(obj interface{}) ([]string, error) {
}
from := trigger.ImageChange.From

// the default imagechange trigger has no "from" value, it
// uses the input image of the buildconfig as the imagestream
// to trigger off, so we need to look that up.
// We're indexing on the imagestream referenced by the imagechangetrigger,
// however buildconfigs allow one "default" imagechangetrigger in which
// the ICT does not explicitly indicate the image it is triggering on,
// instead it triggers on the image being used as the builder/base image
// as referenced in the build strategy, so if this is an ICT w/ no
// explicit image reference, use the image referenced by the strategy
// because this is the default ICT.
if from == nil {
from = buildutil.GetInputReference(t.Spec.Strategy)
if from == nil || from.Kind != "ImageStreamTag" {
Expand Down
4 changes: 2 additions & 2 deletions pkg/deploy/controller/deployment/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const (
// We must avoid creating processing deployment configs until the deployment config and image
// stream stores have synced. If it hasn't synced, to avoid a hot loop, we'll wait this long
// between checks.
StoreSyncedPollPeriod = 100 * time.Millisecond
storeSyncedPollPeriod = 100 * time.Millisecond
)

// NewDeploymentController creates a new DeploymentController.
Expand Down Expand Up @@ -90,7 +90,7 @@ func (c *DeploymentController) waitForSyncedStores(ready chan<- struct{}, stopCh
for !c.rcStoreSynced() || !c.podStoreSynced() {
glog.V(4).Infof("Waiting for the rc and pod caches to sync before starting the deployment controller workers")
select {
case <-time.After(StoreSyncedPollPeriod):
case <-time.After(storeSyncedPollPeriod):
case <-stopCh:
return
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/deploy/controller/deploymentconfig/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const (
// We must avoid creating new replication controllers until the deployment config and replication
// controller stores have synced. If it hasn't synced, to avoid a hot loop, we'll wait this long
// between checks.
StoreSyncedPollPeriod = 100 * time.Millisecond
storeSyncedPollPeriod = 100 * time.Millisecond
// MaxRetries is the number of times a deployment config will be retried before it is dropped out
// of the queue.
MaxRetries = 5
Expand Down Expand Up @@ -99,7 +99,7 @@ func (c *DeploymentConfigController) waitForSyncedStores(ready chan<- struct{},
for !c.dcStoreSynced() || !c.rcStoreSynced() || !c.podStoreSynced() {
glog.V(4).Infof("Waiting for the dc, rc, and pod caches to sync before starting the deployment config controller workers")
select {
case <-time.After(StoreSyncedPollPeriod):
case <-time.After(storeSyncedPollPeriod):
case <-stopCh:
return
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/deploy/controller/generictrigger/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const (
// We must avoid creating processing deployment configs until the deployment config and image
// stream stores have synced. If it hasn't synced, to avoid a hot loop, we'll wait this long
// between checks.
StoreSyncedPollPeriod = 100 * time.Millisecond
storeSyncedPollPeriod = 100 * time.Millisecond
// MaxRetries is the number of times a deployment config will be retried before it is dropped
// out of the queue.
MaxRetries = 5
Expand Down Expand Up @@ -82,7 +82,7 @@ func (c *DeploymentTriggerController) waitForSyncedStore(ready chan<- struct{},
for !c.dcStoreSynced() {
glog.V(4).Infof("Waiting for the deployment config cache to sync before starting the trigger controller workers")
select {
case <-time.After(StoreSyncedPollPeriod):
case <-time.After(storeSyncedPollPeriod):
case <-stopCh:
return
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/deploy/controller/imagechange/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
const (
// We must avoid creating processing image stream until the deployment config and image
// stream stores have synced.
StoreSyncedPollPeriod = 100 * time.Millisecond
storeSyncedPollPeriod = 100 * time.Millisecond
// MaxRetries is the number of times an image stream will be retried before it is dropped
// out of the queue.
MaxRetries = 5
Expand Down Expand Up @@ -78,7 +78,7 @@ func (c *ImageChangeController) waitForSyncedStore(ready chan<- struct{}, stopCh
for !c.streamStoreSynced() || !c.dcStoreSynced() {
glog.V(4).Infof("Waiting for the image stream and deployment config caches to sync before starting the image change controller workers")
select {
case <-time.After(StoreSyncedPollPeriod):
case <-time.After(storeSyncedPollPeriod):
case <-stopCh:
return
}
Expand Down

0 comments on commit f5a2cd8

Please sign in to comment.