forked from cloudfoundry/bosh-bootloader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bosh_config_updater.go
73 lines (62 loc) · 2.23 KB
/
bosh_config_updater.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
package fakes
import (
"github.com/cloudfoundry/bosh-bootloader/bosh"
"github.com/cloudfoundry/bosh-bootloader/storage"
)
type BOSHConfigUpdater struct {
InitializeAuthenticatedCLICall struct {
CallCount int
Receives struct {
State storage.State
}
Returns struct {
AuthenticatedCLIRunner bosh.AuthenticatedCLIRunner
Error error
}
}
UpdateCloudConfigCall struct {
CallCount int
Receives struct {
AuthenticatedCLIRunner bosh.AuthenticatedCLIRunner
Filepath string
OpsFilepaths []string
VarsFilepath string
}
Returns struct {
Error error
}
}
UpdateRuntimeConfigCall struct {
CallCount int
Receives struct {
AuthenticatedCLIRunner bosh.AuthenticatedCLIRunner
Filepath string
OpsFilepaths []string
Name string
}
Returns struct {
Error error
}
}
}
func (c *BOSHConfigUpdater) InitializeAuthenticatedCLI(state storage.State) (bosh.AuthenticatedCLIRunner, error) {
c.InitializeAuthenticatedCLICall.CallCount++
c.InitializeAuthenticatedCLICall.Receives.State = state
return c.InitializeAuthenticatedCLICall.Returns.AuthenticatedCLIRunner, c.InitializeAuthenticatedCLICall.Returns.Error
}
func (c *BOSHConfigUpdater) UpdateRuntimeConfig(authenticatedCLIRunner bosh.AuthenticatedCLIRunner, filepath string, opsFilepaths []string, name string) error {
c.UpdateRuntimeConfigCall.CallCount++
c.UpdateRuntimeConfigCall.Receives.AuthenticatedCLIRunner = authenticatedCLIRunner
c.UpdateRuntimeConfigCall.Receives.Filepath = filepath
c.UpdateRuntimeConfigCall.Receives.OpsFilepaths = opsFilepaths
c.UpdateRuntimeConfigCall.Receives.Name = name
return c.UpdateRuntimeConfigCall.Returns.Error
}
func (c *BOSHConfigUpdater) UpdateCloudConfig(authenticatedCLIRunner bosh.AuthenticatedCLIRunner, filepath string, opsFilepaths []string, varsFilepath string) error {
c.UpdateCloudConfigCall.CallCount++
c.UpdateCloudConfigCall.Receives.AuthenticatedCLIRunner = authenticatedCLIRunner
c.UpdateCloudConfigCall.Receives.Filepath = filepath
c.UpdateCloudConfigCall.Receives.OpsFilepaths = opsFilepaths
c.UpdateCloudConfigCall.Receives.VarsFilepath = varsFilepath
return c.UpdateCloudConfigCall.Returns.Error
}