@@ -168,7 +168,7 @@ func EnsureSSHKeyPresentInTheCluster(ctx context.Context, ocConfig oc.Config, ss
168
168
}
169
169
stdout , stderr , err := ocConfig .RunOcCommand ("get" , "machineconfigs" , "99-master-ssh" , "-o" , `jsonpath='{.spec.config.passwd.users[0].sshAuthorizedKeys[0]}'` )
170
170
if err != nil {
171
- return fmt .Errorf ("Failed to get machine configs %v: %s" , err , stderr )
171
+ return fmt .Errorf ("failed to get machine configs %v: %s" , err , stderr )
172
172
}
173
173
if stdout == string (sshPublicKey ) {
174
174
return nil
@@ -179,7 +179,7 @@ func EnsureSSHKeyPresentInTheCluster(ctx context.Context, ocConfig oc.Config, ss
179
179
"--type" , "merge" }
180
180
_ , stderr , err = ocConfig .RunOcCommand (cmdArgs ... )
181
181
if err != nil {
182
- return fmt .Errorf ("Failed to update ssh key %v: %s" , err , stderr )
182
+ return fmt .Errorf ("failed to update ssh key %v: %s" , err , stderr )
183
183
}
184
184
return nil
185
185
}
@@ -191,7 +191,7 @@ func EnsurePullSecretPresentInTheCluster(ctx context.Context, ocConfig oc.Config
191
191
192
192
stdout , stderr , err := ocConfig .RunOcCommandPrivate ("get" , "secret" , "pull-secret" , "-n" , "openshift-config" , "-o" , `jsonpath="{['data']['\.dockerconfigjson']}"` )
193
193
if err != nil {
194
- return fmt .Errorf ("Failed to get pull secret %v: %s" , err , stderr )
194
+ return fmt .Errorf ("failed to get pull secret %v: %s" , err , stderr )
195
195
}
196
196
decoded , err := base64 .StdEncoding .DecodeString (stdout )
197
197
if err != nil {
@@ -213,7 +213,7 @@ func EnsurePullSecretPresentInTheCluster(ctx context.Context, ocConfig oc.Config
213
213
214
214
_ , stderr , err = ocConfig .RunOcCommandPrivate (cmdArgs ... )
215
215
if err != nil {
216
- return fmt .Errorf ("Failed to add Pull secret %v: %s" , err , stderr )
216
+ return fmt .Errorf ("failed to add Pull secret %v: %s" , err , stderr )
217
217
}
218
218
return nil
219
219
}
@@ -225,7 +225,7 @@ func EnsureGeneratedClientCAPresentInTheCluster(ctx context.Context, ocConfig oc
225
225
}
226
226
clusterClientCA , stderr , err := ocConfig .RunOcCommand ("get" , "configmaps" , "admin-kubeconfig-client-ca" , "-n" , "openshift-config" , "-o" , `jsonpath="{.data.ca-bundle\.crt}"` )
227
227
if err != nil {
228
- return fmt .Errorf ("Failed to get config map %v: %s" , err , stderr )
228
+ return fmt .Errorf ("failed to get config map %v: %s" , err , stderr )
229
229
}
230
230
231
231
ok , err := crctls .VerifyCertificateAgainstRootCA (clusterClientCA , adminCert )
@@ -242,10 +242,10 @@ func EnsureGeneratedClientCAPresentInTheCluster(ctx context.Context, ocConfig oc
242
242
"-n" , "openshift-config" , "--patch" , jsonPath }
243
243
_ , stderr , err = ocConfig .RunOcCommand (cmdArgs ... )
244
244
if err != nil {
245
- return fmt .Errorf ("Failed to patch admin-kubeconfig-client-ca config map with new CA` %v: %s" , err , stderr )
245
+ return fmt .Errorf ("failed to patch admin-kubeconfig-client-ca config map with new CA` %v: %s" , err , stderr )
246
246
}
247
247
if err := sshRunner .CopyFile (constants .KubeconfigFilePath , ocConfig .KubeconfigPath , 0644 ); err != nil {
248
- return fmt .Errorf ("Failed to copy generated kubeconfig file to VM: %v" , err )
248
+ return fmt .Errorf ("failed to copy generated kubeconfig file to VM: %v" , err )
249
249
}
250
250
251
251
return nil
@@ -259,7 +259,7 @@ func RemovePullSecretFromCluster(ctx context.Context, ocConfig oc.Config, sshRun
259
259
260
260
_ , stderr , err := ocConfig .RunOcCommand (cmdArgs ... )
261
261
if err != nil {
262
- return fmt .Errorf ("Failed to remove Pull secret %w: %s" , err , stderr )
262
+ return fmt .Errorf ("failed to remove Pull secret %w: %s" , err , stderr )
263
263
}
264
264
return waitForPullSecretRemovedFromInstanceDisk (ctx , sshRunner )
265
265
}
@@ -318,7 +318,7 @@ func RemoveOldRenderedMachineConfig(ocConfig oc.Config) error {
318
318
if deleteRenderedMachineConfig != "" {
319
319
_ , stderr , err = ocConfig .RunOcCommand (fmt .Sprintf ("delete %s" , deleteRenderedMachineConfig ))
320
320
if err != nil {
321
- return fmt .Errorf ("Failed to remove machineconfigpools %w: %s" , err , stderr )
321
+ return fmt .Errorf ("failed to remove machineconfigpools %w: %s" , err , stderr )
322
322
}
323
323
}
324
324
return nil
@@ -331,7 +331,7 @@ func EnsureClusterIDIsNotEmpty(ctx context.Context, ocConfig oc.Config) error {
331
331
332
332
stdout , stderr , err := ocConfig .RunOcCommand ("get" , "clusterversion" , "version" , "-o" , `jsonpath="{['spec']['clusterID']}"` )
333
333
if err != nil {
334
- return fmt .Errorf ("Failed to get clusterversion %v: %s" , err , stderr )
334
+ return fmt .Errorf ("failed to get clusterversion %v: %s" , err , stderr )
335
335
}
336
336
if strings .TrimSpace (stdout ) != "" {
337
337
return nil
@@ -344,7 +344,7 @@ func EnsureClusterIDIsNotEmpty(ctx context.Context, ocConfig oc.Config) error {
344
344
345
345
_ , stderr , err = ocConfig .RunOcCommand (cmdArgs ... )
346
346
if err != nil {
347
- return fmt .Errorf ("Failed to update cluster ID %v: %s" , err , stderr )
347
+ return fmt .Errorf ("failed to update cluster ID %v: %s" , err , stderr )
348
348
}
349
349
350
350
return nil
@@ -389,13 +389,13 @@ func AddProxyConfigToCluster(ctx context.Context, sshRunner *ssh.Runner, ocConfi
389
389
390
390
patchEncode , err := json .Marshal (patch )
391
391
if err != nil {
392
- return fmt .Errorf ("Failed to encode to json: %v" , err )
392
+ return fmt .Errorf ("failed to encode to json: %v" , err )
393
393
}
394
394
logging .Debugf ("Patch string %s" , string (patchEncode ))
395
395
396
396
cmdArgs := []string {"patch" , "proxy" , "cluster" , "-p" , fmt .Sprintf ("'%s'" , string (patchEncode )), "--type" , "merge" }
397
397
if _ , stderr , err := ocConfig .RunOcCommandPrivate (cmdArgs ... ); err != nil {
398
- return fmt .Errorf ("Failed to add proxy details %v: %s" , err , stderr )
398
+ return fmt .Errorf ("failed to add proxy details %v: %s" , err , stderr )
399
399
}
400
400
return nil
401
401
}
@@ -423,7 +423,7 @@ func addProxyCACertToCluster(sshRunner *ssh.Runner, ocConfig oc.Config, proxy *h
423
423
}
424
424
cmdArgs := []string {"apply" , "-f" , proxyConfigMapFileName }
425
425
if _ , stderr , err := ocConfig .RunOcCommandPrivate (cmdArgs ... ); err != nil {
426
- return fmt .Errorf ("Failed to add proxy cert details %v: %s" , err , stderr )
426
+ return fmt .Errorf ("failed to add proxy cert details %v: %s" , err , stderr )
427
427
}
428
428
return nil
429
429
}
0 commit comments