Remove expandbird address and URL command line flags

pull/573/head
jackgr 9 years ago
parent dc91ff264b
commit 8e8bbb3f56

@ -83,15 +83,19 @@ func setupDependencies(c *router.Context) error {
return nil
}
const expanderPort = "8080"
const deployerPort = "8080"
const (
expanderName = "expander-service"
expanderPort = "8080"
expanderURL = "http://localhost:8081"
deployerPort = "8080"
)
func newManager(c *router.Context) manager.Manager {
cfg := c.Config
service := repo.NewInmemRepoService()
cp := c.CredentialProvider
rp := repo.NewRepoProvider(service, repo.NewGCSRepoProvider(cp), cp)
expander := manager.NewExpander(util.GetServiceURL(cfg.ExpanderURL, cfg.ExpanderName, expanderPort), rp)
expander := manager.NewExpander(util.GetServiceURL(expanderURL, expanderName, expanderPort), rp)
deployer := manager.NewDeployer(util.GetServiceURL(cfg.DeployerURL, cfg.DeployerName, deployerPort))
address := strings.TrimPrefix(util.GetServiceURL(cfg.MongoAddress, cfg.MongoName, cfg.MongoPort), "http://")
repository := createRepository(address)

@ -31,8 +31,6 @@ import (
var (
port = flag.Int("port", 8080, "The port to listen on")
maxLength = flag.Int64("maxLength", 1024, "The maximum length (KB) of a template.")
expanderName = flag.String("expander", "expandybird-service", "The DNS name of the expander service.")
expanderURL = flag.String("expanderURL", "", "The URL for the expander service.")
deployerName = flag.String("deployer", "resourcifier-service", "The DNS name of the deployer service.")
deployerURL = flag.String("deployerURL", "", "The URL for the deployer service.")
credentialFile = flag.String("credentialFile", "", "Local file to use for credentials.")
@ -73,8 +71,6 @@ func parseFlags() *router.Config {
return &router.Config{
Address: fmt.Sprintf(":%d", *port),
MaxTemplateLength: *maxLength,
ExpanderName: *expanderName,
ExpanderURL: *expanderURL,
DeployerName: *deployerName,
DeployerURL: *deployerURL,
CredentialFile: *credentialFile,

@ -31,10 +31,6 @@ type Config struct {
Address string
// MaxTemplateLength is the maximum length of a template.
MaxTemplateLength int64
// ExpanderName is the DNS name of the expansion service.
ExpanderName string
// ExpanderURL is the expander service's URL.
ExpanderURL string
// DeployerName is the deployer's DNS name
DeployerName string
// DeployerURL is the deployer's URL

Loading…
Cancel
Save