mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
kubeadm/join: expose the KubeConfigPath() method to joinData
This fixes the following error: "error execution phase control-plane-join/etcd: control-plane-join phase invoked with an invalid data struct" The problem here is that joinData cannot be type-asserted to the interface type under controlplanejoin.go (controlPlaneJoinData) because joinData lacks KubeConfigPath. Given we use KubeConfigPath in more than one place for join it makes sense to define define the method and make it return: kubeadmconstants.GetAdminKubeConfigPath()
This commit is contained in:
parent
e1b8cb515c
commit
5db0c61788
@ -173,7 +173,7 @@ func NewCmdJoin(out io.Writer, joinOptions *joinOptions) *cobra.Command {
|
||||
}
|
||||
|
||||
ctx := map[string]string{
|
||||
"KubeConfigPath": kubeadmconstants.GetAdminKubeConfigPath(),
|
||||
"KubeConfigPath": data.KubeConfigPath(),
|
||||
"etcdMessage": etcdMessage,
|
||||
}
|
||||
joinControPlaneDoneTemp.Execute(data.outputWriter, ctx)
|
||||
@ -380,6 +380,11 @@ func (j *joinData) Cfg() *kubeadmapi.JoinConfiguration {
|
||||
return j.cfg
|
||||
}
|
||||
|
||||
// KubeConfigPath returns the default kubeconfig path.
|
||||
func (j *joinData) KubeConfigPath() string {
|
||||
return kubeadmconstants.GetAdminKubeConfigPath()
|
||||
}
|
||||
|
||||
// TLSBootstrapCfg returns the cluster-info (kubeconfig).
|
||||
func (j *joinData) TLSBootstrapCfg() (*clientcmdapi.Config, error) {
|
||||
if j.tlsBootstrapCfg != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user