@@ -8,174 +8,174 @@ import (
88 "github.com/replicatedhq/embedded-cluster/api/types"
99)
1010
11- func (c * client ) GetInstallationConfig () (* types.InstallationConfig , error ) {
11+ func (c * client ) GetInstallationConfig () (types.InstallationConfig , error ) {
1212 req , err := http .NewRequest ("GET" , c .apiURL + "/api/install/installation/config" , nil )
1313 if err != nil {
14- return nil , err
14+ return types. InstallationConfig {} , err
1515 }
1616 req .Header .Set ("Content-Type" , "application/json" )
1717 setAuthorizationHeader (req , c .token )
1818
1919 resp , err := c .httpClient .Do (req )
2020 if err != nil {
21- return nil , err
21+ return types. InstallationConfig {} , err
2222 }
2323 defer resp .Body .Close ()
2424
2525 if resp .StatusCode != http .StatusOK {
26- return nil , errorFromResponse (resp )
26+ return types. InstallationConfig {} , errorFromResponse (resp )
2727 }
2828
2929 var config types.InstallationConfig
3030 err = json .NewDecoder (resp .Body ).Decode (& config )
3131 if err != nil {
32- return nil , err
32+ return types. InstallationConfig {} , err
3333 }
3434
35- return & config , nil
35+ return config , nil
3636}
3737
38- func (c * client ) ConfigureInstallation (config * types.InstallationConfig ) (* types.Status , error ) {
38+ func (c * client ) ConfigureInstallation (config types.InstallationConfig ) (types.Status , error ) {
3939 b , err := json .Marshal (config )
4040 if err != nil {
41- return nil , err
41+ return types. Status {} , err
4242 }
4343
4444 req , err := http .NewRequest ("POST" , c .apiURL + "/api/install/installation/configure" , bytes .NewBuffer (b ))
4545 if err != nil {
46- return nil , err
46+ return types. Status {} , err
4747 }
4848 req .Header .Set ("Content-Type" , "application/json" )
4949 setAuthorizationHeader (req , c .token )
5050
5151 resp , err := c .httpClient .Do (req )
5252 if err != nil {
53- return nil , err
53+ return types. Status {} , err
5454 }
5555 defer resp .Body .Close ()
5656
5757 if resp .StatusCode != http .StatusOK {
58- return nil , errorFromResponse (resp )
58+ return types. Status {} , errorFromResponse (resp )
5959 }
6060
6161 var status types.Status
6262 err = json .NewDecoder (resp .Body ).Decode (& status )
6363 if err != nil {
64- return nil , err
64+ return types. Status {} , err
6565 }
6666
67- return & status , nil
67+ return status , nil
6868}
6969
70- func (c * client ) GetInstallationStatus () (* types.Status , error ) {
70+ func (c * client ) GetInstallationStatus () (types.Status , error ) {
7171 req , err := http .NewRequest ("GET" , c .apiURL + "/api/install/installation/status" , nil )
7272 if err != nil {
73- return nil , err
73+ return types. Status {} , err
7474 }
7575 req .Header .Set ("Content-Type" , "application/json" )
7676 setAuthorizationHeader (req , c .token )
7777
7878 resp , err := c .httpClient .Do (req )
7979 if err != nil {
80- return nil , err
80+ return types. Status {} , err
8181 }
8282 defer resp .Body .Close ()
8383
8484 if resp .StatusCode != http .StatusOK {
85- return nil , errorFromResponse (resp )
85+ return types. Status {} , errorFromResponse (resp )
8686 }
8787
8888 var status types.Status
8989 err = json .NewDecoder (resp .Body ).Decode (& status )
9090 if err != nil {
91- return nil , err
91+ return types. Status {} , err
9292 }
9393
94- return & status , nil
94+ return status , nil
9595}
9696
97- func (c * client ) SetupInfra () (* types.Infra , error ) {
97+ func (c * client ) SetupInfra () (types.Infra , error ) {
9898 req , err := http .NewRequest ("POST" , c .apiURL + "/api/install/infra/setup" , nil )
9999 if err != nil {
100- return nil , err
100+ return types. Infra {} , err
101101 }
102102 req .Header .Set ("Content-Type" , "application/json" )
103103 setAuthorizationHeader (req , c .token )
104104
105105 resp , err := c .httpClient .Do (req )
106106 if err != nil {
107- return nil , err
107+ return types. Infra {} , err
108108 }
109109 defer resp .Body .Close ()
110110
111111 if resp .StatusCode != http .StatusOK {
112- return nil , errorFromResponse (resp )
112+ return types. Infra {} , errorFromResponse (resp )
113113 }
114114
115115 var infra types.Infra
116116 err = json .NewDecoder (resp .Body ).Decode (& infra )
117117 if err != nil {
118- return nil , err
118+ return types. Infra {} , err
119119 }
120120
121- return & infra , nil
121+ return infra , nil
122122}
123123
124- func (c * client ) GetInfraStatus () (* types.Infra , error ) {
124+ func (c * client ) GetInfraStatus () (types.Infra , error ) {
125125 req , err := http .NewRequest ("GET" , c .apiURL + "/api/install/infra/status" , nil )
126126 if err != nil {
127- return nil , err
127+ return types. Infra {} , err
128128 }
129129 req .Header .Set ("Content-Type" , "application/json" )
130130 setAuthorizationHeader (req , c .token )
131131
132132 resp , err := c .httpClient .Do (req )
133133 if err != nil {
134- return nil , err
134+ return types. Infra {} , err
135135 }
136136 defer resp .Body .Close ()
137137
138138 if resp .StatusCode != http .StatusOK {
139- return nil , errorFromResponse (resp )
139+ return types. Infra {} , errorFromResponse (resp )
140140 }
141141
142142 var infra types.Infra
143143 err = json .NewDecoder (resp .Body ).Decode (& infra )
144144 if err != nil {
145- return nil , err
145+ return types. Infra {} , err
146146 }
147147
148- return & infra , nil
148+ return infra , nil
149149}
150150
151- func (c * client ) SetInstallStatus (s * types.Status ) (* types.Status , error ) {
151+ func (c * client ) SetInstallStatus (s types.Status ) (types.Status , error ) {
152152 b , err := json .Marshal (s )
153153 if err != nil {
154- return nil , err
154+ return types. Status {} , err
155155 }
156156
157157 req , err := http .NewRequest ("POST" , c .apiURL + "/api/install/status" , bytes .NewBuffer (b ))
158158 if err != nil {
159- return nil , err
159+ return types. Status {} , err
160160 }
161161 req .Header .Set ("Content-Type" , "application/json" )
162162 setAuthorizationHeader (req , c .token )
163163
164164 resp , err := c .httpClient .Do (req )
165165 if err != nil {
166- return nil , err
166+ return types. Status {} , err
167167 }
168168 defer resp .Body .Close ()
169169
170170 if resp .StatusCode != http .StatusOK {
171- return nil , errorFromResponse (resp )
171+ return types. Status {} , errorFromResponse (resp )
172172 }
173173
174174 var status types.Status
175175 err = json .NewDecoder (resp .Body ).Decode (& status )
176176 if err != nil {
177- return nil , err
177+ return types. Status {} , err
178178 }
179179
180- return & status , nil
180+ return status , nil
181181}
0 commit comments