client-go: PatchType is not supported for ApplyPatchType in fake
Hi, When I write a tests:
fakeReadyDeployment := fake.NewSimpleClientset(&appV1.Deployment{
TypeMeta: metav1.TypeMeta{
Kind: "Deployment",
APIVersion: "apps/v1",
},
ObjectMeta: metav1.ObjectMeta{
Name: deploymentName,
Namespace: "default",
},
}).AppsV1().Deployments("default")
After try to apply:
_, err := fakeReadyDeployment.Apply(context.TODO(), deployment, metav1.ApplyOptions{
FieldManager: appUID,
})
I get: PatchType is not supported
Because we have 4 of const: k8s.io/apimachinery@v0.21.0/pkg/types/patch.go:25
const (
JSONPatchType PatchType = "application/json-patch+json"
MergePatchType PatchType = "application/merge-patch+json"
StrategicMergePatchType PatchType = "application/strategic-merge-patch+json"
ApplyPatchType PatchType = "application/apply-patch+yaml"
)
But in switch only 3 case: https://github.com/kubernetes/client-go/blob/master/testing/fixture.go#L150
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 21
- Comments: 26 (6 by maintainers)
See https://github.com/kubernetes/client-go/issues/1184 for a workaround.
@k8s-triage-robot: Closing this issue.
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.