Skip to content

Commit

Permalink
Refresh the connection after the k8s migration
Browse files Browse the repository at this point in the history
After the k8s migration the pod has been started again since the initial
connection creation. We need to reset the connection to not search for
the old pod name.
  • Loading branch information
cbosdo committed Aug 7, 2024
1 parent a82eea8 commit dd1c300
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions mgradm/cmd/migrate/kubernetes/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ func migrateToKubernetes(
return err
}

// Reinitialize the connection since the pod name has changed since we first checked
cnx = shared.NewConnection("kubectl", "", shared_kubernetes.ServerFilter)
if err := cnx.CopyCaCertificate(fqdn); err != nil {
return utils.Errorf(err, L("failed to add SSL CA certificate to host trusted certificates"))
}
Expand Down
2 changes: 1 addition & 1 deletion mgradm/shared/kubernetes/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func Deploy(
return cnx.WaitForServer()
}

// DeployCertificate executre a deploy a new certificate given an helm.
// DeployCertificate deploys a new SSL certificate.
func DeployCertificate(helmFlags *cmd_utils.HelmFlags, sslFlags *cmd_utils.SslCertFlags, rootCa string,
ca *ssl.SslPair, kubeconfig string, fqdn string, imagePullPolicy string) ([]string, error) {
helmArgs := []string{}
Expand Down

0 comments on commit dd1c300

Please sign in to comment.