Skip to content

Commit

Permalink
fix cert sans revision for kubeadm join
Browse files Browse the repository at this point in the history
Signed-off-by: Piyush Kumar <k17piyush@gmail.com>
  • Loading branch information
kpiyush17 committed Dec 24, 2024
1 parent 562c289 commit a6b8451
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
6 changes: 6 additions & 0 deletions stages/join.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ func GetJoinYipStagesV1Beta3(clusterCtx *domain.ClusterContext, kubeadmConfig do
utils.MutateClusterConfigBeta3Defaults(clusterCtx, &kubeadmConfig.ClusterConfiguration)
utils.MutateKubeletDefaults(clusterCtx, &kubeadmConfig.KubeletConfiguration)

clusterCtx.KubeletArgs = utils.RegenerateKubeletKubeadmArgsUsingBeta3Config(&kubeadmConfig.JoinConfiguration.NodeRegistration, clusterCtx.NodeRole)
clusterCtx.CertSansRevision = utils.GetCertSansRevision(kubeadmConfig.ClusterConfiguration.APIServer.CertSANs)

joinStg := []yip.Stage{
getKubeadmJoinConfigStage(getJoinNodeConfigurationBeta3(clusterCtx, kubeadmConfig.JoinConfiguration), clusterCtx.RootPath),
getKubeadmJoinStage(clusterCtx),
Expand All @@ -43,6 +46,9 @@ func GetJoinYipStagesV1Beta4(clusterCtx *domain.ClusterContext, kubeadmConfig do
utils.MutateClusterConfigBeta4Defaults(clusterCtx, &kubeadmConfig.ClusterConfiguration)
utils.MutateKubeletDefaults(clusterCtx, &kubeadmConfig.KubeletConfiguration)

clusterCtx.KubeletArgs = utils.RegenerateKubeletKubeadmArgsUsingBeta4Config(&kubeadmConfig.JoinConfiguration.NodeRegistration, clusterCtx.NodeRole)
clusterCtx.CertSansRevision = utils.GetCertSansRevision(kubeadmConfig.ClusterConfiguration.APIServer.CertSANs)

joinStg := []yip.Stage{
getKubeadmJoinConfigStage(getJoinNodeConfigurationBeta4(clusterCtx, kubeadmConfig.JoinConfiguration), clusterCtx.RootPath),
getKubeadmJoinStage(clusterCtx),
Expand Down
14 changes: 5 additions & 9 deletions utils/kubelet.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import (
)

type kubeletFlagsOpts struct {
name string
pauseImage string
criSocket string
taints []v1.Taint
kubeletExtraArgs map[string]string
name string
criSocket string
taints []v1.Taint
kubeletExtraArgs map[string]string

registerTaintsUsingFlags bool
}

Expand Down Expand Up @@ -72,10 +72,6 @@ func buildKubeletArgMapCommon(opts kubeletFlagsOpts) map[string]string {
kubeletFlags["container-runtime-endpoint"] = opts.criSocket
}

if opts.pauseImage != "" {
kubeletFlags["pod-infra-container-image"] = opts.pauseImage
}

if opts.registerTaintsUsingFlags && opts.taints != nil && len(opts.taints) > 0 {
var taintStrs []string
for _, taint := range opts.taints {
Expand Down

0 comments on commit a6b8451

Please sign in to comment.