Skip to content

Commit

Permalink
use ConfigView in delete path
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Jones committed Mar 27, 2019
1 parent f0ead86 commit 053ecdb
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion concourse/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ var _ = Describe("client", func() {
actions = append(actions, fmt.Sprintf("storing config asset: %s", filename))
return nil
}
configClient.DeleteAllStub = func(config config.Config) error {
configClient.DeleteAllStub = func(config config.ConfigView) error {
actions = append(actions, "deleting config")
return nil
}
Expand Down
28 changes: 14 additions & 14 deletions concourse/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,22 +131,22 @@ func (client *Client) Deploy() error {
return err
}

func (client *Client) deployBoshAndPipeline(c config.Config, tfOutputs terraform.Outputs) (BoshParams, error) {
func (client *Client) deployBoshAndPipeline(c config.ConfigView, tfOutputs terraform.Outputs) (BoshParams, error) {
// When we are deploying for the first time rather than updating
// ensure that the pipeline is set _after_ the concourse is deployed

bp := BoshParams{
CredhubPassword: c.CredhubPassword,
CredhubAdminClientSecret: c.CredhubAdminClientSecret,
CredhubCACert: c.CredhubCACert,
CredhubURL: c.CredhubURL,
CredhubUsername: c.CredhubUsername,
ConcourseUsername: c.ConcourseUsername,
ConcoursePassword: c.ConcoursePassword,
GrafanaPassword: c.GrafanaPassword,
DirectorUsername: c.DirectorUsername,
DirectorPassword: c.DirectorPassword,
DirectorCACert: c.DirectorCACert,
CredhubPassword: c.GetCredhubPassword(),
CredhubAdminClientSecret: c.GetCredhubAdminClientSecret(),
CredhubCACert: c.GetCredhubCACert(),
CredhubURL: c.GetCredhubURL(),
CredhubUsername: c.GetCredhubUsername(),
ConcourseUsername: c.GetConcourseUsername(),
ConcoursePassword: c.GetConcoursePassword(),
GrafanaPassword: c.GetGrafanaPassword(),
DirectorUsername: c.GetDirectorUsername(),
DirectorPassword: c.GetDirectorPassword(),
DirectorCACert: c.GetDirectorCACert(),
}

bp, err := client.deployBosh(c, tfOutputs, false)
Expand All @@ -155,8 +155,8 @@ func (client *Client) deployBoshAndPipeline(c config.Config, tfOutputs terraform
}

flyClient, err := client.flyClientFactory(client.provider, fly.Credentials{
Target: c.Deployment,
API: fmt.Sprintf("https://%s", c.Domain),
Target: c.GetDeployment(),
API: fmt.Sprintf("https://%s", c.GetDomain()),
Username: bp.ConcourseUsername,
Password: bp.ConcoursePassword,
},
Expand Down
2 changes: 1 addition & 1 deletion concourse/destroy.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func (client *Client) Destroy() error {
return err1
}
zone := client.provider.Zone("")
err1 = client.provider.DeleteVMsInDeployment(zone, project, conf.Deployment)
err1 = client.provider.DeleteVMsInDeployment(zone, project, conf.GetDeployment())
if err1 != nil {
return err1
}
Expand Down
6 changes: 3 additions & 3 deletions config/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const configFilePath = "config.json"
//go:generate counterfeiter . IClient
type IClient interface {
Load() (Config, error)
DeleteAll(config Config) error
DeleteAll(config ConfigView) error
Update(Config) error
StoreAsset(filename string, contents []byte) error
HasAsset(filename string) (bool, error)
Expand Down Expand Up @@ -88,8 +88,8 @@ func (client *Client) Update(config Config) error {
}

// DeleteAll deletes the entire configuration bucket
func (client *Client) DeleteAll(config Config) error {
return client.Iaas.DeleteVersionedBucket(config.ConfigBucket)
func (client *Client) DeleteAll(config ConfigView) error {
return client.Iaas.DeleteVersionedBucket(config.GetConfigBucket())
}

// Load loads an existing config file from S3
Expand Down
12 changes: 6 additions & 6 deletions config/configfakes/fake_iclient.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 053ecdb

Please sign in to comment.