Commit 8e8bbb3f authored by jackgr's avatar jackgr

Remove expandbird address and URL command line flags

parent dc91ff26
...@@ -83,15 +83,19 @@ func setupDependencies(c *router.Context) error { ...@@ -83,15 +83,19 @@ func setupDependencies(c *router.Context) error {
return nil return nil
} }
const expanderPort = "8080" const (
const deployerPort = "8080" expanderName = "expander-service"
expanderPort = "8080"
expanderURL = "http://localhost:8081"
deployerPort = "8080"
)
func newManager(c *router.Context) manager.Manager { func newManager(c *router.Context) manager.Manager {
cfg := c.Config cfg := c.Config
service := repo.NewInmemRepoService() service := repo.NewInmemRepoService()
cp := c.CredentialProvider cp := c.CredentialProvider
rp := repo.NewRepoProvider(service, repo.NewGCSRepoProvider(cp), cp) 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)) deployer := manager.NewDeployer(util.GetServiceURL(cfg.DeployerURL, cfg.DeployerName, deployerPort))
address := strings.TrimPrefix(util.GetServiceURL(cfg.MongoAddress, cfg.MongoName, cfg.MongoPort), "http://") address := strings.TrimPrefix(util.GetServiceURL(cfg.MongoAddress, cfg.MongoName, cfg.MongoPort), "http://")
repository := createRepository(address) repository := createRepository(address)
......
...@@ -31,8 +31,6 @@ import ( ...@@ -31,8 +31,6 @@ import (
var ( var (
port = flag.Int("port", 8080, "The port to listen on") port = flag.Int("port", 8080, "The port to listen on")
maxLength = flag.Int64("maxLength", 1024, "The maximum length (KB) of a template.") 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.") deployerName = flag.String("deployer", "resourcifier-service", "The DNS name of the deployer service.")
deployerURL = flag.String("deployerURL", "", "The URL for the deployer service.") deployerURL = flag.String("deployerURL", "", "The URL for the deployer service.")
credentialFile = flag.String("credentialFile", "", "Local file to use for credentials.") credentialFile = flag.String("credentialFile", "", "Local file to use for credentials.")
...@@ -73,8 +71,6 @@ func parseFlags() *router.Config { ...@@ -73,8 +71,6 @@ func parseFlags() *router.Config {
return &router.Config{ return &router.Config{
Address: fmt.Sprintf(":%d", *port), Address: fmt.Sprintf(":%d", *port),
MaxTemplateLength: *maxLength, MaxTemplateLength: *maxLength,
ExpanderName: *expanderName,
ExpanderURL: *expanderURL,
DeployerName: *deployerName, DeployerName: *deployerName,
DeployerURL: *deployerURL, DeployerURL: *deployerURL,
CredentialFile: *credentialFile, CredentialFile: *credentialFile,
......
...@@ -31,10 +31,6 @@ type Config struct { ...@@ -31,10 +31,6 @@ type Config struct {
Address string Address string
// MaxTemplateLength is the maximum length of a template. // MaxTemplateLength is the maximum length of a template.
MaxTemplateLength int64 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 is the deployer's DNS name
DeployerName string DeployerName string
// DeployerURL is the deployer's URL // DeployerURL is the deployer's URL
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment