From a6b84516ea1d4a67081294c3d1f349cc4dc7fb4a Mon Sep 17 00:00:00 2001 From: Piyush Kumar Date: Tue, 24 Dec 2024 06:01:35 +0530 Subject: [PATCH 1/2] fix cert sans revision for kubeadm join Signed-off-by: Piyush Kumar --- stages/join.go | 6 ++++++ utils/kubelet.go | 14 +++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/stages/join.go b/stages/join.go index 23b83f1..667bf66 100644 --- a/stages/join.go +++ b/stages/join.go @@ -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), @@ -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), diff --git a/utils/kubelet.go b/utils/kubelet.go index a14b6b3..47982f1 100644 --- a/utils/kubelet.go +++ b/utils/kubelet.go @@ -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 } @@ -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 { From d6c3e26a11b2e4ed6890b17b5d87976a3a04aafb Mon Sep 17 00:00:00 2001 From: Piyush Kumar Date: Tue, 24 Dec 2024 19:22:29 +0530 Subject: [PATCH 2/2] updated lint action step --- .github/workflows/pull_request.yaml | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml index c5b6fba..96b5c66 100644 --- a/.github/workflows/pull_request.yaml +++ b/.github/workflows/pull_request.yaml @@ -14,10 +14,16 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: docker-practice/actions-setup-docker@master + - name: Set up QEMU + uses: docker/setup-qemu-action@master + with: + platforms: all + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master - uses: earthly/actions-setup@v1 with: - version: "v0.6.30" + version: "latest" - run: earthly --ci +lint build-provider-package: runs-on: ubuntu-latest @@ -25,7 +31,16 @@ jobs: packages: write steps: - uses: actions/checkout@v4 - - uses: docker-practice/actions-setup-docker@master + - name: Set up QEMU + uses: docker/setup-qemu-action@master + with: + platforms: all + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + - uses: earthly/actions-setup@v1 + with: + version: "latest" - uses: earthly/actions-setup@v1 with: version: "v0.6.30"