Skip to content
This repository was archived by the owner on Jun 19, 2022. It is now read-only.

Commit

Permalink
Replace ReadonlyTargets interface with a TargetsConfig channel
Browse files Browse the repository at this point in the history
A channel provides a simple and safe interface for config updates. The in-memory
config is no longer needed as tests can simply write config values to the config
channel. For the volume config the config channel replaces the notify channel
and the config watcher writes updated config values to the channel.
  • Loading branch information
ian-mi committed Apr 10, 2020
1 parent e361668 commit 0a5f861
Show file tree
Hide file tree
Showing 25 changed files with 283 additions and 1,224 deletions.
7 changes: 6 additions & 1 deletion cmd/broker/ingress/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package main

import (
"github.com/google/knative-gcp/pkg/broker/config/volume"
"github.com/google/knative-gcp/pkg/broker/ingress"
"github.com/google/knative-gcp/pkg/utils"
"github.com/kelseyhightower/envconfig"
Expand Down Expand Up @@ -52,7 +53,11 @@ func main() {
}
logger.Desugar().Info("Starting ingress handler", zap.Any("envConfig", env), zap.Any("Project ID", projectID))

ingress, err := ingress.NewHandler(ctx, ingress.WithPort(env.Port), ingress.WithProjectID(projectID))
targets, err := volume.NewTargetsFromFile()
if err != nil {
logger.Desugar().Fatal("Unable to get targets config: %v", zap.Error(err))
}
ingress, err := ingress.NewHandler(ctx, targets, ingress.WithPort(env.Port), ingress.WithProjectID(projectID))
if err != nil {
logger.Desugar().Fatal("Unable to create ingress handler: ", zap.Error(err))
}
Expand Down
122 changes: 0 additions & 122 deletions pkg/broker/config/cache.go

This file was deleted.

Loading

0 comments on commit 0a5f861

Please sign in to comment.