mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-19 18:02:01 +00:00
kubeadm: add unit tests for patching a "kubeletconfiguration" target
This commit is contained in:
parent
85fb6b01f8
commit
c3c9fb8608
@ -26,7 +26,7 @@ import (
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"k8s.io/api/core/v1"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
)
|
||||
|
||||
@ -35,6 +35,7 @@ var testKnownTargets = []string{
|
||||
"kube-apiserver",
|
||||
"kube-controller-manager",
|
||||
"kube-scheduler",
|
||||
"kubeletconfiguration",
|
||||
}
|
||||
|
||||
const testDirPattern = "patch-files"
|
||||
@ -312,6 +313,21 @@ func TestGetPatchManagerForPath(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "valid: kubeletconfiguration target is patched with json patch",
|
||||
patchTarget: &PatchTarget{
|
||||
Name: "kubeletconfiguration",
|
||||
StrategicMergePatchObject: nil,
|
||||
Data: []byte("foo: bar\n"),
|
||||
},
|
||||
expectedData: []byte(`{"foo":"zzz"}`),
|
||||
files: []*file{
|
||||
{
|
||||
name: "kubeletconfiguration+json.json",
|
||||
data: `[{"op": "replace", "path": "/foo", "value": "zzz"}]`,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "valid: kube-apiserver target is patched with strategic merge patch",
|
||||
patchTarget: &PatchTarget{
|
||||
|
Loading…
Reference in New Issue
Block a user