Skip to content

Commit

Permalink
Differentiate CloudProviderName and KubeletCloudProviderName
Browse files Browse the repository at this point in the history
Signed-off-by: Marko Mudrinić <mudrinic.mare@gmail.com>
  • Loading branch information
xmudrii committed Jan 13, 2022
1 parent 1747405 commit 7e9a3df
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 29 deletions.
29 changes: 15 additions & 14 deletions pkg/apis/plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,21 @@ const (

// UserDataRequest requests user data with the given arguments.
type UserDataRequest struct {
MachineSpec clusterv1alpha1.MachineSpec
Kubeconfig *clientcmdapi.Config
CloudProviderName string
CloudConfig string
DNSIPs []net.IP
ExternalCloudProvider bool
HTTPProxy string
NoProxy string
PauseImage string
KubeletFeatureGates map[string]bool
KubeletConfigs map[string]string
ContainerRuntime containerruntime.Config
PodCIDR string
NodePortRange string
MachineSpec clusterv1alpha1.MachineSpec
Kubeconfig *clientcmdapi.Config
CloudProviderName string
CloudConfig string
DNSIPs []net.IP
ExternalCloudProvider bool
HTTPProxy string
NoProxy string
PauseImage string
KubeletCloudProviderName string
KubeletFeatureGates map[string]bool
KubeletConfigs map[string]string
ContainerRuntime containerruntime.Config
PodCIDR string
NodePortRange string
}

// UserDataResponse contains the responded user data.
Expand Down
31 changes: 16 additions & 15 deletions pkg/controller/machine/machine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ func (r *Reconciler) ensureInstanceExistsForMachine(
return nil, fmt.Errorf("failed to create bootstrap kubeconfig: %v", err)
}

cloudConfig, cloudProviderName, err := prov.GetCloudConfig(machine.Spec)
cloudConfig, kubeletCloudProviderName, err := prov.GetCloudConfig(machine.Spec)
if err != nil {
return nil, fmt.Errorf("failed to render cloud config: %v", err)
}
Expand Down Expand Up @@ -746,20 +746,21 @@ func (r *Reconciler) ensureInstanceExistsForMachine(
crRuntime.RegistryCredentials = registryCredentials

req := plugin.UserDataRequest{
MachineSpec: machine.Spec,
Kubeconfig: kubeconfig,
CloudConfig: cloudConfig,
CloudProviderName: cloudProviderName,
ExternalCloudProvider: externalCloudProvider,
DNSIPs: r.nodeSettings.ClusterDNSIPs,
PauseImage: r.nodeSettings.PauseImage,
KubeletFeatureGates: kubeletFeatureGates,
KubeletConfigs: KubeletConfigs,
NoProxy: r.nodeSettings.NoProxy,
HTTPProxy: r.nodeSettings.HTTPProxy,
ContainerRuntime: crRuntime,
PodCIDR: r.podCIDR,
NodePortRange: r.nodePortRange,
MachineSpec: machine.Spec,
Kubeconfig: kubeconfig,
CloudConfig: cloudConfig,
CloudProviderName: string(providerConfig.CloudProvider),
ExternalCloudProvider: externalCloudProvider,
DNSIPs: r.nodeSettings.ClusterDNSIPs,
PauseImage: r.nodeSettings.PauseImage,
KubeletCloudProviderName: kubeletCloudProviderName,
KubeletFeatureGates: kubeletFeatureGates,
KubeletConfigs: KubeletConfigs,
NoProxy: r.nodeSettings.NoProxy,
HTTPProxy: r.nodeSettings.HTTPProxy,
ContainerRuntime: crRuntime,
PodCIDR: r.podCIDR,
NodePortRange: r.nodePortRange,
}

// Here we do stuff!
Expand Down

0 comments on commit 7e9a3df

Please sign in to comment.