4848type Deployer struct {
4949 db models.DB
5050 Redis streams.RedisClient
51- tfPluginClient deployer.TFPluginClient
51+ TFPluginClient deployer.TFPluginClient
5252 prices internal.Prices
5353
5454 vmDeployed chan bool
@@ -108,12 +108,12 @@ func (d *Deployer) PeriodicDeploy(ctx context.Context, sec int) {
108108 }
109109
110110 if len (vms ) > 0 {
111- err := d .tfPluginClient .NetworkDeployer .BatchDeploy (ctx , vmNets )
111+ err := d .TFPluginClient .NetworkDeployer .BatchDeploy (ctx , vmNets )
112112 if err != nil {
113113 log .Error ().Err (err ).Msg ("failed to batch deploy network" )
114114 }
115115
116- err = d .tfPluginClient .DeploymentDeployer .BatchDeploy (ctx , vms )
116+ err = d .TFPluginClient .DeploymentDeployer .BatchDeploy (ctx , vms )
117117 if err != nil {
118118 log .Error ().Err (err ).Msg ("failed to batch deploy vm" )
119119 }
@@ -124,12 +124,12 @@ func (d *Deployer) PeriodicDeploy(ctx context.Context, sec int) {
124124 }
125125
126126 if len (clusters ) > 0 {
127- err := d .tfPluginClient .NetworkDeployer .BatchDeploy (ctx , k8sNets )
127+ err := d .TFPluginClient .NetworkDeployer .BatchDeploy (ctx , k8sNets )
128128 if err != nil {
129129 log .Error ().Err (err ).Msg ("failed to batch deploy network" )
130130 }
131131
132- err = d .tfPluginClient .K8sDeployer .BatchDeploy (ctx , clusters )
132+ err = d .TFPluginClient .K8sDeployer .BatchDeploy (ctx , clusters )
133133 if err != nil {
134134 log .Error ().Err (err ).Msg ("failed to batch deploy clusters" )
135135 }
@@ -144,24 +144,24 @@ func (d *Deployer) PeriodicDeploy(ctx context.Context, sec int) {
144144// CancelDeployment cancel deployments from grid
145145func (d * Deployer ) CancelDeployment (contractID uint64 , netContractID uint64 , dlType string , dlName string ) error {
146146 // cancel deployment
147- err := d .tfPluginClient .SubstrateConn .CancelContract (d .tfPluginClient .Identity , contractID )
147+ err := d .TFPluginClient .SubstrateConn .CancelContract (d .TFPluginClient .Identity , contractID )
148148 if err != nil {
149149 return err
150150 }
151151
152152 // cancel network
153- err = d .tfPluginClient .SubstrateConn .CancelContract (d .tfPluginClient .Identity , netContractID )
153+ err = d .TFPluginClient .SubstrateConn .CancelContract (d .TFPluginClient .Identity , netContractID )
154154 if err != nil {
155155 return err
156156 }
157157
158158 // update state
159- for node , contracts := range d .tfPluginClient .State .CurrentNodeDeployments {
159+ for node , contracts := range d .TFPluginClient .State .CurrentNodeDeployments {
160160 contracts = workloads .Delete (contracts , contractID )
161161 contracts = workloads .Delete (contracts , netContractID )
162- d .tfPluginClient .State .CurrentNodeDeployments [node ] = contracts
162+ d .TFPluginClient .State .CurrentNodeDeployments [node ] = contracts
163163
164- d .tfPluginClient .State .Networks .DeleteNetwork (fmt .Sprintf ("%s%sNet" , dlType , dlName ))
164+ d .TFPluginClient .State .Networks .DeleteNetwork (fmt .Sprintf ("%s%sNet" , dlType , dlName ))
165165 }
166166
167167 return nil
0 commit comments