From 4bf5f1a6b31b3450444f5d49130ed6f037155694 Mon Sep 17 00:00:00 2001 From: Sohan Kunkerkar Date: Thu, 2 Jan 2025 12:54:40 -0500 Subject: [PATCH] kubelet: add coverage for identical kubelet config and drop-in config content Added test coverage for the second part of https://github.com/kubernetes/kubernetes/issues/124796 --- cmd/kubelet/app/server_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/cmd/kubelet/app/server_test.go b/cmd/kubelet/app/server_test.go index ba965049d7f0e..01e1c5b063a44 100644 --- a/cmd/kubelet/app/server_test.go +++ b/cmd/kubelet/app/server_test.go @@ -273,6 +273,24 @@ port: 123 name: "empty drop-in apiVersion/kind", expectMergeError: `'Kind' is missing`, }, + { + name: "identical kubelet config and drop-in file", + kubeletConfig: &kubeletconfiginternal.KubeletConfiguration{ + TypeMeta: metav1.TypeMeta{ + Kind: "KubeletConfiguration", + APIVersion: "kubelet.config.k8s.io/v1beta1", + }, + Port: int32(9090), + ReadOnlyPort: int32(10255), + }, + dropin1: ` +apiVersion: kubelet.config.k8s.io/v1beta1 +kind: KubeletConfiguration +port: 9090 +readOnlyPort: 10255 +`, + expectMergeError: "", + }, } for _, test := range testCases {