Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
Signed-off-by: razzle <[email protected]>
  • Loading branch information
Noxsios committed Oct 19, 2023
1 parent e9e2ec1 commit 4d5f1d3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/pkg/packager/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,16 @@ func (p *Packager) isConnectedToCluster() bool {

func (p *Packager) connectToCluster() (err error) {
if p.isConnectedToCluster() {
old := p.cluster.RestConfig.ServerName
// TODO: what is the best way to handle this?
old := p.cluster.RestConfig.String()

// If we are already connected to the cluster, check if the server name has changed
cluster, err := cluster.NewCluster()
if err != nil {
return fmt.Errorf("unable to connect to the Kubernetes cluster: %w", err)
}

if old != cluster.RestConfig.ServerName {
if old != cluster.RestConfig.String() {
message.Warnf("The Kubernetes cluster has changed from %q to %q", old, cluster.RestConfig.ServerName)

p.cluster = cluster
Expand Down

0 comments on commit 4d5f1d3

Please sign in to comment.