-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Kimmo Lehto <[email protected]>
- Loading branch information
Showing
13 changed files
with
133 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,29 @@ | ||
package action | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/k0sproject/k0sctl/phase" | ||
"github.com/k0sproject/k0sctl/pkg/apis/k0sctl.k0sproject.io/v1beta1" | ||
"github.com/k0sproject/k0sctl/pkg/apis/k0sctl.k0sproject.io/v1beta1/cluster" | ||
) | ||
|
||
type Kubeconfig struct { | ||
Config *v1beta1.Cluster | ||
Concurrency int | ||
// Manager is the phase manager | ||
Manager *phase.Manager | ||
KubeconfigAPIAddress string | ||
|
||
Kubeconfig string | ||
} | ||
|
||
func (k *Kubeconfig) Run() error { | ||
if k.Config == nil { | ||
return fmt.Errorf("config is nil") | ||
} | ||
|
||
c := k.Config | ||
|
||
// Change so that the internal config has only single controller host as we | ||
// do not need to connect to all nodes | ||
c.Spec.Hosts = cluster.Hosts{c.Spec.K0sLeader()} | ||
manager := phase.Manager{Config: k.Config, Concurrency: k.Concurrency} | ||
k.Manager.Config.Spec.Hosts = cluster.Hosts{k.Manager.Config.Spec.K0sLeader()} | ||
|
||
manager.AddPhase( | ||
k.Manager.AddPhase( | ||
&phase.Connect{}, | ||
&phase.DetectOS{}, | ||
&phase.GetKubeconfig{APIAddress: k.KubeconfigAPIAddress}, | ||
&phase.Disconnect{}, | ||
) | ||
|
||
return manager.Run() | ||
return k.Manager.Run() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.